|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.systems.core.SystemResourceHelpers
A class with helper methods for working with the underlying Eclipse resources * needed for filters, filter pools and filter pool managers.
Field Summary | |
---|---|
static String |
copyright
|
Constructor Summary | |
---|---|
SystemResourceHelpers()
Constructor |
Method Summary | |
---|---|
boolean |
accept(File file)
Method required by FilenameFilter interface, used by java.io.File.list() |
IFile[] |
convertToFileArray(Vector vector)
Convert a vector of IFile objects to an array of IFile |
IFolder[] |
convertToFolderArray(Vector vector)
Convert a vector of IFolder objects to an array of IFolder |
Vector |
convertToVector(String[] array)
Convert a name array to a vector. |
Vector |
convertToVectorAndStrip(String[] array,
String namePrefix,
String nameSuffix)
Convert a name array to a vector. |
boolean |
createFolder(IFolder folder)
Create new folder |
boolean |
deleteFile(IFile file)
Delete a file |
boolean |
deleteFolder(IFolder folder)
Delete a folder |
void |
deleteResource(IResource fileOrFolder)
Method to delete a folder or file and absorb the exception |
boolean |
ensureFolderExists(IFolder folder)
Create a folder, if it does not already exist. |
boolean |
exists(IResource resource)
For some reason the exists() method on IResource is fundamentally not reliable |
boolean |
fileExists(IFile file)
Check if a file exists in the file system |
IFile |
getFile(IContainer parent,
String fileName)
Get a file whose parent is either a project or a folder |
static String |
getFilePath(IFile file)
Return the path of the given file |
IFolder |
getFolder(IContainer parent,
String folderName)
Get a folder whose parent is either a project or a folder |
String |
getFolderPath(IFolder folder)
Return the path of the given folder |
IFolder |
getOrCreateFolder(IContainer parentFolder,
String folderName)
Create a folder, if it does not already exist. |
IFolder |
getRenamedFolder(IFolder oldFolder,
String newFolderName)
Re-get a folder which has been renamed. |
static SystemResourceHelpers |
getResourceHelpers()
Return common instance if unique instance not required. |
IFile[] |
listFiles(IContainer projectOrFolder)
Return a list of child files in the given container * @param projectOrFolder The parent container to search |
String[] |
listFiles(IFolder folder,
String namePrefix,
String nameSuffix)
Return a list of names of files in the given container * @param folder The folder to query * @param namePrefix Optional prefix all names should match. |
IFolder[] |
listFolders(IContainer projectOrFolder)
Return a list of child folders in the given container * @param projectOrFolder The parent container to search |
IFolder[] |
listFolders(IContainer projectOrFolder,
String fileName)
Return a list of child folders in the given container, * which contain a file of the given name |
String[] |
listFolders(IFolder folder,
String namePrefix,
String nameSuffix)
Return a list of names of folders in the given container * @param folder The folder to query * @param namePrefix Optional prefix all names should match. |
void |
logException(String msg,
Exception exc)
|
void |
logMessage(String msg)
|
boolean |
moveFile(IFolder newParent,
IFile file)
Move a file |
boolean |
moveFolder(IFolder newParent,
IFolder folder)
Move a folder |
void |
refreshResource(IResource fileOrFolder)
Refresh a resource from disk. |
void |
refreshResourceShallow(IResource fileOrFolder)
Refresh a resource from disk. |
boolean |
renameFile(IFile file,
String newName)
Rename a file * @param newName - the name name for the file, unqualified! |
boolean |
renameFolder(IFolder folder,
String newName)
Rename a folder |
void |
renameResource(IResource fileOrFolder,
String newName)
Method to rename a folder or file and absorb the exception |
void |
setListValues(boolean filesOnly,
boolean foldersOnly,
String namePrefix,
String nameSuffix)
Method to set variables to affect the folder content subsetting |
static boolean |
testIfResourceInUse(IResource resource)
Test if a resource is in use, prior to attempting to rename or delete it |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String copyright
Constructor Detail |
public SystemResourceHelpers()
Method Detail |
public static SystemResourceHelpers getResourceHelpers()
public void deleteResource(IResource fileOrFolder)
public void renameResource(IResource fileOrFolder, String newName)
public void refreshResource(IResource fileOrFolder)
public void refreshResourceShallow(IResource fileOrFolder)
public static boolean testIfResourceInUse(IResource resource)
public IFolder getOrCreateFolder(IContainer parentFolder, String folderName)
public boolean ensureFolderExists(IFolder folder)
public IFolder getFolder(IContainer parent, String folderName)
public IFolder getRenamedFolder(IFolder oldFolder, String newFolderName)
public boolean createFolder(IFolder folder)
public boolean deleteFolder(IFolder folder) throws Exception
Exception
public boolean renameFolder(IFolder folder, String newName) throws Exception
Exception
public boolean moveFolder(IFolder newParent, IFolder folder) throws Exception
Exception
public String getFolderPath(IFolder folder)
public IFolder[] listFolders(IContainer projectOrFolder)
public IFolder[] listFolders(IContainer projectOrFolder, String fileName)
public String[] listFolders(IFolder folder, String namePrefix, String nameSuffix)
public IFile getFile(IContainer parent, String fileName)
public boolean fileExists(IFile file)
public boolean deleteFile(IFile file) throws Exception
Exception
public boolean renameFile(IFile file, String newName) throws Exception
Exception
public boolean moveFile(IFolder newParent, IFile file) throws Exception
Exception
public static String getFilePath(IFile file)
public IFile[] listFiles(IContainer projectOrFolder)
public String[] listFiles(IFolder folder, String namePrefix, String nameSuffix)
public IFolder[] convertToFolderArray(Vector vector)
public IFile[] convertToFileArray(Vector vector)
public Vector convertToVector(String[] array)
public Vector convertToVectorAndStrip(String[] array, String namePrefix, String nameSuffix)
public void setListValues(boolean filesOnly, boolean foldersOnly, String namePrefix, String nameSuffix)
public boolean accept(File file)
accept
in interface FileFilter
public void logMessage(String msg)
public void logException(String msg, Exception exc)
public boolean exists(IResource resource)
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |