org.codehaus.plexus.archiver.util
Class ResourceUtils

java.lang.Object
  extended by org.codehaus.plexus.archiver.util.ResourceUtils

public class ResourceUtils
extends java.lang.Object

Utility class for work with PlexusIoResource instances.


Method Summary
static void copyFile(org.codehaus.plexus.components.io.resources.PlexusIoResource in, java.io.File outFile)
          Copies the sources contents to the given destination file.
static boolean isCanonicalizedSame(org.codehaus.plexus.components.io.resources.PlexusIoResource resource, java.io.File file)
          Checks, whether the resource and the file are identical.
static boolean isSame(org.codehaus.plexus.components.io.resources.PlexusIoResource resource, java.io.File file)
          Checks, whether the resource and the file are identical.
static boolean isUptodate(long sourceDate, long destinationDate)
          Queries, whether the given source is uptodate relative to the given modification date.
static boolean isUptodate(org.codehaus.plexus.components.io.resources.PlexusIoResource source, java.io.File destination)
          Queries, whether the given source is uptodate relative to the given destination.
static boolean isUptodate(org.codehaus.plexus.components.io.resources.PlexusIoResource source, long destinationDate)
          Queries, whether the given source is uptodate relative to the given modification date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isUptodate

public static boolean isUptodate(org.codehaus.plexus.components.io.resources.PlexusIoResource source,
                                 java.io.File destination)
Queries, whether the given source is uptodate relative to the given destination.


isUptodate

public static boolean isUptodate(org.codehaus.plexus.components.io.resources.PlexusIoResource source,
                                 long destinationDate)
Queries, whether the given source is uptodate relative to the given modification date.


isUptodate

public static boolean isUptodate(long sourceDate,
                                 long destinationDate)
Queries, whether the given source is uptodate relative to the given modification date.


copyFile

public static void copyFile(org.codehaus.plexus.components.io.resources.PlexusIoResource in,
                            java.io.File outFile)
                     throws java.io.IOException
Copies the sources contents to the given destination file.

Throws:
java.io.IOException

isSame

public static boolean isSame(org.codehaus.plexus.components.io.resources.PlexusIoResource resource,
                             java.io.File file)
Checks, whether the resource and the file are identical.


isCanonicalizedSame

public static boolean isCanonicalizedSame(org.codehaus.plexus.components.io.resources.PlexusIoResource resource,
                                          java.io.File file)
                                   throws java.io.IOException
Checks, whether the resource and the file are identical. Uses File.getCanonicalFile() for comparison, which is much slower than comparing the files.

Throws:
java.io.IOException


Copyright © 2001-2010 Codehaus. All Rights Reserved.