public class FileSystemUtils extends Object
| Constructor and Description |
|---|
FileSystemUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyFile(String srcPath,
String destPath)
Copy file.
|
static void |
copyFolder(String srcPath,
String destPath)
Copy folder.
|
static boolean |
createFile(String workspacePath)
Creates the file.
|
static boolean |
createFolder(String workspacePath)
Creates the folder.
|
static void |
createFoldersIfNecessary(String workspacePath)
Creates the folders if necessary.
|
static boolean |
directoryExists(String location)
Directory exists.
|
static boolean |
exists(String location)
Exists.
|
static boolean |
fileExists(String location)
File exists.
|
static String |
getExtension(String workspacePath)
Gets the extension.
|
static Date |
getModifiedAt(String workspacePath)
Gets the modified at.
|
static String |
getOwner(String workspacePath)
Gets the owner.
|
static boolean |
isDirectory(String location)
Checks if is directory.
|
static byte[] |
loadFile(String workspacePath)
Load file.
|
static void |
moveFile(String workspacePathOld,
String workspacePathNew)
Move file.
|
static void |
removeFile(String workspacePath)
Removes the file.
|
static void |
saveFile(String workspacePath,
byte[] content)
Save file.
|
public static void saveFile(String workspacePath, byte[] content) throws FileNotFoundException, IOException
workspacePath - the workspace pathcontent - the contentFileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.public static byte[] loadFile(String workspacePath) throws FileNotFoundException, IOException
workspacePath - the workspace pathFileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.public static void moveFile(String workspacePathOld, String workspacePathNew) throws FileNotFoundException, IOException
workspacePathOld - the workspace path oldworkspacePathNew - the workspace path newFileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.public static void copyFile(String srcPath, String destPath) throws FileNotFoundException, IOException
srcPath - the src pathdestPath - the dest pathFileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.public static void copyFolder(String srcPath, String destPath) throws FileNotFoundException, IOException
srcPath - the src pathdestPath - the dest pathFileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.public static void removeFile(String workspacePath) throws FileNotFoundException, IOException
workspacePath - the workspace pathFileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.public static boolean createFolder(String workspacePath)
workspacePath - the workspace pathpublic static boolean createFile(String workspacePath) throws IOException
workspacePath - the workspace pathIOException - Signals that an I/O exception has occurred.public static String getExtension(String workspacePath) throws IOException
workspacePath - the workspace pathIOException - Signals that an I/O exception has occurred.public static String getOwner(String workspacePath) throws IOException
workspacePath - the workspace pathIOException - Signals that an I/O exception has occurred.public static Date getModifiedAt(String workspacePath) throws IOException
workspacePath - the workspace pathIOException - Signals that an I/O exception has occurred.public static void createFoldersIfNecessary(String workspacePath)
workspacePath - the workspace pathpublic static boolean exists(String location)
location - the locationpublic static boolean directoryExists(String location)
location - the locationpublic static boolean fileExists(String location)
location - the locationpublic static boolean isDirectory(String location)
location - the locationCopyright © 2010–2018 Eclipse Foundation. All rights reserved.