|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.acmsl.antmake.FolderStructureHelper
Provides some useful methods for managing the folder structure of a typical GNU Autotools-based Java project.
Constructor Summary | |
protected |
FolderStructureHelper()
Protected constructor to avoid accidental instantiation. |
Method Summary | |
void |
copy(java.lang.String fileName,
java.io.File destination,
org.apache.tools.ant.Task task,
java.lang.ClassLoader classLoader)
Copies a file from the classpath to given location. |
void |
createFolderStructure(java.io.File newBaseFolder,
java.io.File oldBaseFolder,
java.io.File[] files,
org.apache.tools.ant.Task task)
Creates the basic folder structure starting from given folder. |
protected void |
createFolderStructure(java.io.File baseFolder,
java.lang.String[] packageNames)
Creates the basic folder structure starting from given folder and packages. |
java.io.File |
createTempFolder()
Creates a temporary folder. |
java.io.InputStream |
findResource(java.lang.String resource,
java.lang.ClassLoader classLoader)
Retrieves the input stream to read a resource from the classpath visible to given class loader. |
static FolderStructureHelper |
getInstance()
Retrieves a FolderStructureHelper instance. |
protected static java.lang.ref.WeakReference |
getReference()
Retrieves the weak reference. |
protected static void |
setReference(FolderStructureHelper helper)
Specifies a new weak reference. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected FolderStructureHelper()
Method Detail |
protected static void setReference(FolderStructureHelper helper)
helper
- the helper instance to use.protected static java.lang.ref.WeakReference getReference()
public static FolderStructureHelper getInstance()
public void createFolderStructure(java.io.File newBaseFolder, java.io.File oldBaseFolder, java.io.File[] files, org.apache.tools.ant.Task task) throws AntMakeException
newBaseFolder
- the new base folder.oldBaseFolder
- the old base folder.files
- the files to include, which have to be relative to
oldBaseFolder.task
- to be able to log messages.
AntMakeException
- if the structure cannot be created
for some reason.protected void createFolderStructure(java.io.File baseFolder, java.lang.String[] packageNames)
baseFolder
- the base folder.packageNames
- the package names.public java.io.File createTempFolder() throws java.io.IOException
java.io.IOException
- if the folder cannot be created.public void copy(java.lang.String fileName, java.io.File destination, org.apache.tools.ant.Task task, java.lang.ClassLoader classLoader) throws java.io.IOException
fileName
- the file name.destination
- the destination folder.task
- the Ant task to print error messages.classLoader
- the optional class loader.
java.io.IOException
- if an abnormal situation takes place.public java.io.InputStream findResource(java.lang.String resource, java.lang.ClassLoader classLoader)
resource
- the resource to find.classLoader
- (optional) the class loader.
null
if the
resource cannot be found.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |