|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectarchimate.util.FileHandler
public class FileHandler
Utility class for handling source files
Constructor Summary | |
---|---|
FileHandler()
|
Method Summary | |
---|---|
int |
countFiles(java.lang.String packageBase)
Counts the number of source files in a Java project source folder. |
org.eclipse.core.resources.IContainer |
findOrCreateContainer(java.lang.String packageName)
Finds or creates a container for the specified directory and package |
java.lang.String |
getSource(org.eclipse.core.resources.IFile file)
Gets the contents of a file and returns it as a string. |
void |
openResource(org.eclipse.core.resources.IResource resource)
Opens the newly created file in a new editor in Eclipse |
org.eclipse.core.resources.IFile |
save(java.lang.String contents,
org.eclipse.core.resources.IFile file)
Saves the contents to an already opened file |
org.eclipse.core.resources.IFile |
save(java.lang.String contents,
java.lang.String packageName,
java.lang.String targetFile)
Saves the specified contents to a location specified by the targetFolder, packageName and targetFile parameters. |
void |
selectAndReveal(org.eclipse.core.resources.IResource newResource)
Reveals the newly created file in the Eclipse Package Explorer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileHandler()
Method Detail |
---|
public int countFiles(java.lang.String packageBase)
public java.lang.String getSource(org.eclipse.core.resources.IFile file)
file
- The file to be read
public org.eclipse.core.resources.IContainer findOrCreateContainer(java.lang.String packageName)
packageName
- The package to create the container in
public org.eclipse.core.resources.IFile save(java.lang.String contents, java.lang.String packageName, java.lang.String targetFile)
contents
- The contents of the file to savepackageName
- The package the file is saved intargetFile
- The file name
public org.eclipse.core.resources.IFile save(java.lang.String contents, org.eclipse.core.resources.IFile file)
contents
- The contents stringfile
- The open file to write to
public void selectAndReveal(org.eclipse.core.resources.IResource newResource)
newResource
- The file to revealpublic void openResource(org.eclipse.core.resources.IResource resource)
resource
- The resource to open
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |