Class ResourceUtils
- java.lang.Object
-
- org.codehaus.plexus.archiver.util.ResourceUtils
-
public class ResourceUtils extends Object
Utility class for work withPlexusIoResourceinstances.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopyFile(InputStream input, File outFile)Copies the sources contents to the given destination file.static voidcopyFile(org.codehaus.plexus.components.io.resources.PlexusIoResource in, File outFile)Copies the sources contents to the given destination file.static booleanisCanonicalizedSame(org.codehaus.plexus.components.io.resources.PlexusIoResource resource, File file)Checks, whether the resource and the file are identical.static booleanisSame(org.codehaus.plexus.components.io.resources.PlexusIoResource resource, File file)Checks, whether the resource and the file are identical.static booleanisUptodate(long sourceDate, long destinationDate)Queries, whether the given source is up-to-date relative to the given modification date.static booleanisUptodate(org.codehaus.plexus.components.io.resources.PlexusIoResource source, long destinationDate)Queries, whether the given source is up-to-date relative to the given modification date.static booleanisUptodate(org.codehaus.plexus.components.io.resources.PlexusIoResource source, File destination)Queries, whether the given source is up-to-date relative to the given destination.
-
-
-
Method Detail
-
isUptodate
public static boolean isUptodate(org.codehaus.plexus.components.io.resources.PlexusIoResource source, File destination)Queries, whether the given source is up-to-date 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 up-to-date relative to the given modification date.
-
isUptodate
public static boolean isUptodate(long sourceDate, long destinationDate)Queries, whether the given source is up-to-date relative to the given modification date.
-
copyFile
public static void copyFile(org.codehaus.plexus.components.io.resources.PlexusIoResource in, File outFile) throws IOExceptionCopies the sources contents to the given destination file.- Throws:
IOException
-
copyFile
public static void copyFile(InputStream input, File outFile) throws IOException
Copies the sources contents to the given destination file.- Throws:
IOException
-
isSame
public static boolean isSame(org.codehaus.plexus.components.io.resources.PlexusIoResource resource, File file)Checks, whether the resource and the file are identical.
-
isCanonicalizedSame
public static boolean isCanonicalizedSame(org.codehaus.plexus.components.io.resources.PlexusIoResource resource, File file) throws IOExceptionChecks, whether the resource and the file are identical. UsesFile.getCanonicalFile()for comparison, which is much slower than comparing the files.- Throws:
IOException
-
-