FvctxImagePath.java
2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.scene7.is.catalog.util.ObjectTypeEnum
* com.scene7.is.provider.catalog.Catalog
* com.scene7.is.provider.catalog.CatalogException
* com.scene7.is.provider.catalog.ObjectRecord
* com.scene7.is.util.UniversalPath
* com.scene7.is.util.text.ParsingException
* com.scene7.is.util.text.parsers.URLDecodeParser
* org.jetbrains.annotations.NotNull
*/
package com.scene7.is.ps.provider.fvctx;
import com.scene7.is.catalog.util.ObjectTypeEnum;
import com.scene7.is.provider.catalog.Catalog;
import com.scene7.is.provider.catalog.CatalogException;
import com.scene7.is.provider.catalog.ObjectRecord;
import com.scene7.is.ps.provider.RequestBuilderUtil;
import com.scene7.is.util.UniversalPath;
import com.scene7.is.util.text.ParsingException;
import com.scene7.is.util.text.parsers.URLDecodeParser;
import org.jetbrains.annotations.NotNull;
public class FvctxImagePath {
@NotNull
public static String canonicalizeImagePath(@NotNull Catalog catalog, @NotNull String path) throws ParsingException, CatalogException {
String preparedPath = FvctxImagePath.preparePath(path);
Catalog pathCatalog = catalog.getRecord(preparedPath).getCatalog();
return RequestBuilderUtil.getAbsolutePath(pathCatalog, preparedPath);
}
@NotNull
public static String canonicalizeVideoPath(@NotNull Catalog catalog, @NotNull String path) throws ParsingException, CatalogException {
String preparedPath = FvctxImagePath.preparePath(path);
Catalog pathCatalog = catalog.getRecord(preparedPath, ObjectTypeEnum.STATIC).getCatalog();
return RequestBuilderUtil.getAbsolutePath(pathCatalog, preparedPath);
}
@NotNull
public static String preparePath(String path) throws ParsingException {
String preparedPath = (String)URLDecodeParser.urlDecodeParser().parse(path);
preparedPath = UniversalPath.collapseSlashes((CharSequence)preparedPath);
preparedPath = UniversalPath.removeTrailingSlashes((CharSequence)preparedPath);
UniversalPath.validatePath((String)preparedPath);
return preparedPath;
}
private FvctxImagePath() {
}
}