Tabnine Logo
org.apache.archiva.common.utils
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.archiva.common.utils

Best Java code snippets using org.apache.archiva.common.utils (Showing top 20 results out of 315)

origin: apache/archiva

public String getRelativePath()
{
  return PathUtil.getRelative( this.baseDir.getAbsolutePath(), this.toPath() );
}
origin: apache/archiva

/**
 * 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 );
}
origin: apache/archiva

@Override
public org.codehaus.plexus.logging.Logger getChildLogger( String name )
{
  return new Slf4JPlexusLogger( log.getName() + "." + name );
}
origin: apache/archiva

public ArchivaArtifact( ArchivaArtifactModel artifactModel )
{
  this.model = artifactModel;
  model.setSnapshot( VersionUtil.isSnapshot( model.getVersion() ) );
  this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() );
}

origin: org.apache.archiva/archiva-common

/**
 * 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() );
}
origin: apache/archiva

private Path getIndexPath( ArchivaIndexingContext ctx )
{
  return PathUtil.getPathFromUri( ctx.getPath( ) );
}
origin: apache/archiva

public static String getDuration( long ms1, long ms2 )
{
  return getDuration( new Date( ms1 ), new Date( ms2 ) );
}
origin: apache/archiva

  public void setBaseDir( String repoDir )
  {
    setBaseDir( new File( repoDir ) );
  }
}
origin: org.apache.archiva/archiva-model

public ArchivaArtifact( ArchivaArtifactModel artifactModel )
{
  this.model = artifactModel;
  model.setSnapshot( VersionUtil.isSnapshot( model.getVersion() ) );
  this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() );
}

origin: apache/archiva

/**
 * 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));
}
origin: apache/archiva

public static String getDuration( long duration )
{
  return getDuration( new Date( 0 ), new Date( duration ) );
}
origin: apache/archiva

private void writeChecksumFile( Path checksumFile, Charset encoding, String checksumHex )
{
  FileUtils.writeStringToFile( checksumFile, FILE_ENCODING, checksumHex + "  " + referenceFile.getFileName( ).toString( ) );
}
origin: org.apache.archiva/archiva-common

@Override
public org.codehaus.plexus.logging.Logger getChildLogger( String name )
{
  return new Slf4JPlexusLogger( log.getName() + "." + name );
}
origin: org.apache.archiva/archiva-common

  public void setBaseDir( String repoDir )
  {
    setBaseDir( new File( repoDir ) );
  }
}
origin: org.apache.archiva/archiva-common

public BaseFile( File repoDir, File pathFile )
{
  this( repoDir, PathUtil.getRelative( repoDir.getAbsolutePath(), pathFile ) );
}
origin: org.apache.archiva/archiva-common

public static String getDuration( long duration )
{
  return getDuration( new Date( 0 ), new Date( duration ) );
}
origin: org.apache.archiva/archiva-common

public String getRelativePath()
{
  return PathUtil.getRelative( this.baseDir.getAbsolutePath(), this );
}
origin: org.apache.archiva/archiva-common

public static String getDuration( long ms1, long ms2 )
{
  return getDuration( new Date( ms1 ), new Date( ms2 ) );
}
origin: apache/archiva

public static String getRelative(String basedir, Path file) {
  return getRelative(Paths.get(basedir), file);
}
origin: apache/archiva

public BaseFile( File repoDir, File pathFile )
{
  this( repoDir, PathUtil.getRelative(repoDir.getAbsolutePath(), pathFile.toPath() ) );
}
org.apache.archiva.common.utils

Most used classes

  • FileUtils
    Utility class for file manipulation
  • VersionUtil
    Version utility methods.
  • PathUtil
    PathUtil - simple utility methods for path manipulation.
  • VersionComparator
    VersionComparator - compare the parts of two version strings. Technique. * Split the version strin
  • BaseFile
    BaseFile - convenient File object that tracks the Base Directory and can provide relative path value
  • Slf4JPlexusLogger
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now