Class SourcePathParser


  • public class SourcePathParser
    extends Object
    • Constructor Detail

      • SourcePathParser

        public SourcePathParser​(String path)
    • Method Detail

      • getArtifactPath

        @NotNull
        public String getArtifactPath()
      • getArchivePath

        @Nullable
        public String getArchivePath()
      • getArchivePathNonWildcard

        @Nullable
        public String getArchivePathNonWildcard()
      • getWildcardIndex

        public static int getWildcardIndex​(String s)
      • hasArchivePath

        public boolean hasArchivePath()
      • getOriginalPath

        public String getOriginalPath()
      • trimBaseDir

        public String trimBaseDir​(String relativePath)
        From relativePath, trims base directory to get target path. Trims only constant part of the path, which is present in sourcePath

        Example:

        • For a source path path/** and given file path/foo/bar.txt will return foo/bar.txt
        • For a source path path/file.txt and given file path/file.txt will return file.txt
        • For a source path file.txt and given file file.txt will return file.txt
        • For a source path path/file.txt and given file path2/file.txt will return path2/file.txt
        Parameters:
        relativePath - incoming relative path
        Returns:
        relativePath with removed source base directory, see above for example