public class PlatformNameFormat
extends java.lang.Object
Illegal characters a generally escaped using the url escaping format, i.e. replacing the char by a '%' hex(char) sequence. special treatment is used for the ':' char since it's used quite often as namespace prefix separator. the PREFIX ':' NAME sequence is replaced by '_' PREFIX '_' NAME. item names that would generate the same pattern are escaped with an extra leading '_'.
Examples:
+-------------------+----------------------+----+----+ | repository name | platform name | pp | sp | +-------------------+----------------------+----+----+ | test.jpg | test.jpg | -1 | -1 | | cq:content | _cq_content | 2 | -1 | | cq:test_image.jpg | _cq_test_image.jpg | 2 | 7 | | test_image.jpg | test_image.jpg | -1 | 4 | | _testimage.jpg | _testimage.jpg | -1 | 0 | | _test_image.jpg | __test_image.jpg | -1 | 0 | +-------------------+----------------------+----+----+ | cq:test:image.jpg | _cq_test%3aimage.jpg | 2 | -1 | | _cq_:test.jpg | __cq_%3atest.jpg | 4 | 0 | | _cq:test.jpg | __cq%3atest.jpg | 3 | 0 | | cq_:test.jpg | cq_%3atest.jpg | 3 | 2 | +-------------------+----------------------+----+----+note for the 2nd set of examples the cases are very rare and justify the ugly '%' escaping.
Constructor and Description |
---|
PlatformNameFormat() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getPlatformName(java.lang.String repositoryName)
Returns the platform name for a given repository name.
|
static java.lang.String |
getPlatformPath(java.lang.String repoPath)
Returns the platform path for the given repository one.
|
static java.lang.String |
getRepositoryName(java.lang.String platformName)
Returns the repository name for a given platform name.
|
static java.lang.String |
getRepositoryPath(java.lang.String path)
Returns the repository path for the given platform one.
|
static java.lang.String |
getRepositoryPath(java.lang.String path,
boolean respectDotDir)
Returns the repository path for the given platform one.
|
public static java.lang.String getPlatformName(java.lang.String repositoryName)
repositoryName
- the repository namepublic static java.lang.String getPlatformPath(java.lang.String repoPath)
repoPath
- the repository pathpublic static java.lang.String getRepositoryName(java.lang.String platformName)
platformName
- the platform namepublic static java.lang.String getRepositoryPath(java.lang.String path)
path
- the platform pathpublic static java.lang.String getRepositoryPath(java.lang.String path, boolean respectDotDir)
path
- the platform pathrespectDotDir
- if true
, all ".dir" are removed.Copyright © 2010 - 2020 Adobe. All Rights Reserved