public String getRelativePath() { return PathUtil.getRelative( this.baseDir.getAbsolutePath(), this.toPath() ); }
/** * TODO: Remove in favor of using FileUtils directly. */ protected void writeStringToFile( Path file, String content ) throws IOException { org.apache.archiva.common.utils.FileUtils.writeStringToFile( file, Charset.defaultCharset(), content ); }
@Override public org.codehaus.plexus.logging.Logger getChildLogger( String name ) { return new Slf4JPlexusLogger( log.getName() + "." + name ); }
public ArchivaArtifact( ArchivaArtifactModel artifactModel ) { this.model = artifactModel; model.setSnapshot( VersionUtil.isSnapshot( model.getVersion() ) ); this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() ); }
/** * 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() ); }
private Path getIndexPath( ArchivaIndexingContext ctx ) { return PathUtil.getPathFromUri( ctx.getPath( ) ); }
public static String getDuration( long ms1, long ms2 ) { return getDuration( new Date( ms1 ), new Date( ms2 ) ); }
public void setBaseDir( String repoDir ) { setBaseDir( new File( repoDir ) ); } }
public ArchivaArtifact( ArchivaArtifactModel artifactModel ) { this.model = artifactModel; model.setSnapshot( VersionUtil.isSnapshot( model.getVersion() ) ); this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() ); }
/** * 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 static String getDuration( long duration ) { return getDuration( new Date( 0 ), new Date( duration ) ); }
private void writeChecksumFile( Path checksumFile, Charset encoding, String checksumHex ) { FileUtils.writeStringToFile( checksumFile, FILE_ENCODING, checksumHex + " " + referenceFile.getFileName( ).toString( ) ); }
@Override public org.codehaus.plexus.logging.Logger getChildLogger( String name ) { return new Slf4JPlexusLogger( log.getName() + "." + name ); }
public void setBaseDir( String repoDir ) { setBaseDir( new File( repoDir ) ); } }
public BaseFile( File repoDir, File pathFile ) { this( repoDir, PathUtil.getRelative( repoDir.getAbsolutePath(), pathFile ) ); }
public static String getDuration( long duration ) { return getDuration( new Date( 0 ), new Date( duration ) ); }
public String getRelativePath() { return PathUtil.getRelative( this.baseDir.getAbsolutePath(), this ); }
public static String getDuration( long ms1, long ms2 ) { return getDuration( new Date( ms1 ), new Date( ms2 ) ); }
public static String getRelative(String basedir, Path file) { return getRelative(Paths.get(basedir), file); }
public BaseFile( File repoDir, File pathFile ) { this( repoDir, PathUtil.getRelative(repoDir.getAbsolutePath(), pathFile.toPath() ) ); }