org.codehaus.plexus.archiver.util

Class ResourceUtils

public class ResourceUtils extends Object

Utility class for work with PlexusIoResource instances.
Method Summary
static voidcopyFile(PlexusIoResource in, File outFile)
Copies the sources contents to the given destination file.
static booleanisCanonicalizedSame(PlexusIoResource resource, File file)
Checks, whether the resource and the file are identical.
static booleanisSame(PlexusIoResource resource, File file)
Checks, whether the resource and the file are identical.
static booleanisUptodate(PlexusIoResource source, File destination)
Queries, whether the given source is uptodate relative to the given destination.
static booleanisUptodate(PlexusIoResource source, long destinationDate)
Queries, whether the given source is uptodate relative to the given modification date.
static booleanisUptodate(long sourceDate, long destinationDate)
Queries, whether the given source is uptodate relative to the given modification date.

Method Detail

copyFile

public static void copyFile(PlexusIoResource in, File outFile)
Copies the sources contents to the given destination file.

isCanonicalizedSame

public static boolean isCanonicalizedSame(PlexusIoResource resource, File file)
Checks, whether the resource and the file are identical. Uses File#getCanonicalFile() for comparison, which is much slower than comparing the files.

isSame

public static boolean isSame(PlexusIoResource resource, File file)
Checks, whether the resource and the file are identical.

isUptodate

public static boolean isUptodate(PlexusIoResource source, File destination)
Queries, whether the given source is uptodate relative to the given destination.

isUptodate

public static boolean isUptodate(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.
Copyright © 2001-2009 Codehaus. All Rights Reserved.