findUniqueFile(File dir, String baseFileName, String suffix) Find unique file name within a directory which can either be a plain file or a directory.
Parameters: dir - eg.
freeJarFile(File origFile) Possibly make a copy of a file to workaround a problem on Windows where a jar file can be
locked and not allow the user to remove it.
public static Project
getActiveProject() Return the Project that is currently active according to the Designer.
getProjectLibraryDirectory(Project project) Returns a directory under the project root under which library resources such as jar files
can be managed by the IDE.
public static boolean deleteRecursive(File dir)(Code)
Deletes all files and subdirectories under dir. Returns true if all deletions were
successful. If a deletion fails, the method stops attempting to delete and returns false.
Parameters: dir -
fileToProject
public static Project fileToProject(File projectDir)(Code)
Returns a NB Project for a project directory or else null if not a project.
Parameters: projectDir - NB Project object or null if not a project
Find unique file name within a directory which can either be a plain file or a directory.
Parameters: dir - eg. an absoluteLibDir Parameters: baseFileName - eg. "sample-date-dt" Parameters: suffix - Can be empty string to mean no suffix. eg. ".jar", ""
Possibly make a copy of a file to workaround a problem on Windows where a jar file can be
locked and not allow the user to remove it. The tradeoff is that the file will be copied
which may take time for large files. A System property can be set to override the default
behavior.
Parameters: origFile - original file eg. jar or complib file throws: IOException -
Get the directory where state of this module is kept. This will be in the userdir and also
part of the NetBeans filesystem so that it will make it easier to migrate to future IDE
versions.
throws: IOException -
Returns the Logger for this NB module. Use Java logging instead of the older NB ErrorManager APIs.
getNetBeansInstallDirectory
public static File getNetBeansInstallDirectory()(Code)
Get the top level netbeans install directory
getProjectLibraryDirectory
public static File getProjectLibraryDirectory(Project project)(Code)
Returns a directory under the project root under which library resources such as jar files
can be managed by the IDE.
Parameters: project - Target project File of the library directory or null if it does not exist
getRaveSamplesDirectory
public static File getRaveSamplesDirectory()(Code)
Unzip a zip or jar file into a dest directory. Derived from jar command in JDK.
Parameters: zipFile - a zip or jar file Parameters: dest - destination directory to contain expanded contents throws: IOException -