|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.emf.emfstore.internal.common.model.util.FileUtil
public final class FileUtil
Helper class for file system operations.
| Method Summary | |
|---|---|
static boolean |
areEqual(File file1,
File file2)
Compares the contents of two files. |
static boolean |
areEqual(File file1,
File file2,
org.eclipse.core.runtime.IProgressMonitor monitor)
Compares the contents of two files. |
static void |
copyDirectory(File source,
File destination)
Copy a directory from source to target including its contained files and directories. |
static void |
copyFile(File source,
File destination)
This method copies a single file. |
static void |
copyFile(InputStream source,
File destination)
This method copies a single file and closes the given stream. |
static void |
deleteDirectory(File file,
boolean force)
Deletes a directory. |
static String |
getExtension(File file)
Returns the extension of the given file. |
static void |
zipFolder(File source,
File destination)
This method allows you to zip a folder. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void copyFile(File source,
File destination)
throws IOException
source - the sourcedestination - the destination
IOException - copy problem
public static void copyFile(InputStream source,
File destination)
throws IOException
source - the source input streamdestination - the destination
IOException - copy problem
public static void copyDirectory(File source,
File destination)
throws IOException
source - directorydestination - directory
IOException - on a IO problem during copy
public static void zipFolder(File source,
File destination)
throws IOException
source - folder to zipdestination - target zip file
IOException - in case of failure
public static boolean areEqual(File file1,
File file2)
file1 - the first filefile2 - the second file
public static boolean areEqual(File file1,
File file2,
org.eclipse.core.runtime.IProgressMonitor monitor)
file1 - the first filefile2 - the second filemonitor - a progress monitor that may be used to indicate the progress of the equality check
public static void deleteDirectory(File file,
boolean force)
throws IOException
file - the directoryforce - true if delete should try to delete forcefully including retries, this may be slow.
IOException - if delete failspublic static String getExtension(File file)
file - the file whose extension should be determined
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||