public class ResourceHandle extends FilesystemHandle
APPEND, READ, WRITE| Constructor and Description |
|---|
ResourceHandle(IFile file,
int mode) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
createFile(boolean createHierarchy)
Create a file.
|
static boolean |
createFolder(IContainer container)
Create a new container on the workbench.
|
boolean |
exists()
Check if a physical file exists.
|
java.lang.Object |
getFile()
Get the base file object.
|
java.nio.file.Path |
getPath()
Returns the java.io.File Path to the underlying file
|
void |
write(byte[] data)
Write data to a file.
|
void |
write(java.lang.String data)
Write data to a file.
|
close, read, readLine, setModepublic ResourceHandle(IFile file, int mode)
public void write(java.lang.String data)
throws java.io.IOException
IFileHandlewrite in interface IFileHandlewrite in class FilesystemHandledata - data to writejava.io.IOException - on write errorspublic void write(byte[] data)
throws java.io.IOException
IFileHandlewrite in interface IFileHandlewrite in class FilesystemHandledata - data to writejava.io.IOException - on write errorspublic java.nio.file.Path getPath()
IFileHandlegetPath in interface IFileHandlegetPath in class FilesystemHandlepublic boolean exists()
IFileHandleexists in interface IFileHandleexists in class FilesystemHandletrue when file existspublic boolean createFile(boolean createHierarchy)
throws CoreException
IFileHandlecreateFile in interface IFileHandlecreateFile in class FilesystemHandlecreateHierarchy - create parent folders if they do not existtrue on successCoreExceptionpublic static boolean createFolder(IContainer container) throws CoreException
container - container to createtrue on successCoreException - thrown when folder cannot be createdpublic java.lang.Object getFile()
IFileHandleIFile or a File instance.getFile in interface IFileHandlegetFile in class FilesystemHandle