/** * Given a basedir and a child file, return the relative path to the child. * * @param basedir the basedir. * @param file the file to get the relative path for. * @return the relative path to the child. (NOTE: this path will NOT start with a {@link File#separator} character) */ public static String getRelative( String basedir, File file ) { return getRelative( basedir, file.getAbsolutePath() ); }
public static String getRelative(String basedir, Path file) { return getRelative(Paths.get(basedir), file); }
/** * Given a basedir and a child file, return the relative path to the child. * * @param basedir the basedir. * @param child the child path (can be a full path) * @return the relative path to the child. (NOTE: this path will NOT start with a file separator character) */ public static String getRelative( String basedir, String child ) { return getRelative(basedir, Paths.get(child)); }
public BaseFile( File repoDir, File pathFile ) { this( repoDir, PathUtil.getRelative( repoDir.getAbsolutePath(), pathFile ) ); }
public String getRelativePath() { return PathUtil.getRelative( this.baseDir.getAbsolutePath(), this ); }
public BaseFile( File repoDir, File pathFile ) { this( repoDir, PathUtil.getRelative(repoDir.getAbsolutePath(), pathFile.toPath() ) ); }
public String getRelativePath() { return PathUtil.getRelative( this.baseDir.getAbsolutePath(), this.toPath() ); }
PathUtil.getRelative( managedRepository.getRepoRoot(), path1 ) ).filter( filetypes::matchesArtifactPattern ).findFirst().orElse( null ); if (result!=null) {
String relativePath = PathUtil.getRelative(repository.getLocation(), repoFile); if ( filetypes.matchesArtifactPattern( relativePath ) )
String relativePath = PathUtil.getRelative(repository.getLocation(), repoFile); if ( filetypes.matchesDefaultExclusions( relativePath ) )
String relativePath = PathUtil.getRelative(repository.getLocation(), repoFile); if ( filetypes.matchesArtifactPattern( relativePath ) )
throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Could not create directory "+destDir ); String relPath = PathUtil.getRelative( rootDirectory.toAbsolutePath().toString(), destDir );