public abstract class FileDAO extends Object
| Constructor and Description |
|---|
FileDAO() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addShortcutAtDeskTop(MavenJarFile mavenJarFile)
Add desktop shortcut.
|
boolean |
addShortcutAtDeskTop(MavenJarFile mavenJarFile,
String iconName)
Adds a shortcut to the desktop.
|
abstract boolean |
createDesktopShortcut(MavenJarFile file,
String iconName,
String toolName,
boolean deleteOldShortcut)
Creates a new Desktop Shortcut to the maven jar file, atm windows only.
|
abstract File |
getLocationToDownloadOnDisk(String targetDownloadFolder)
Try to find an at least somewhat sane location to download files to.
|
MavenJarFile |
getMavenJarFileFromFolderWithArtifactId(File folder,
String artifactId)
Fetches a maven built jar file from a folder for the given artifact id
(e.g peptideshaker or ms-lims).
|
boolean |
unGzipAndUntarFile(GZIPInputStream in,
File fileLocationOnDiskToDownloadTo,
WaitingHandler waitingHandler)
Untars and ungzips a .tar.gz file.
|
boolean |
unzipFile(ZipFile zip,
File fileLocationOnDiskToDownloadTo)
Unzips a zip archive.
|
File |
writeStreamToDisk(InputStream in,
String name,
File outputLocationFolder)
Writes a stream to disk.
|
public abstract boolean createDesktopShortcut(MavenJarFile file, String iconName, String toolName, boolean deleteOldShortcut) throws IOException
file - the maven jarfile to make a shortcut toiconName - the name of the icon file in the resources foldertoolName - the name of the tool, e.g., PeptideShakerdeleteOldShortcut - if previous shortcuts containing the maven jar
file artifact id should be removedIOExceptionpublic boolean addShortcutAtDeskTop(MavenJarFile mavenJarFile)
mavenJarFile - the maven jar filepublic boolean addShortcutAtDeskTop(MavenJarFile mavenJarFile, String iconName) throws NullPointerException, RuntimeException
mavenJarFile - the MavenJarFile to create the shortcut foriconName - the name of the icon in the resource folder of the
MavenJarFile to link toNullPointerExceptionRuntimeExceptionpublic abstract File getLocationToDownloadOnDisk(String targetDownloadFolder) throws IOException
targetDownloadFolder - first place to check if it is a possible
download locationIOExceptionpublic boolean unzipFile(ZipFile zip, File fileLocationOnDiskToDownloadTo) throws IOException
zip - the zipfile to unzipfileLocationOnDiskToDownloadTo - the folder to unzip inIOExceptionpublic boolean unGzipAndUntarFile(GZIPInputStream in, File fileLocationOnDiskToDownloadTo, WaitingHandler waitingHandler) throws IOException
in - a GZIPInputStream of the file that needs to be
ungzipped and untarredfileLocationOnDiskToDownloadTo - the file to ungzip and untar towaitingHandler - the waiting handlerIOExceptionpublic MavenJarFile getMavenJarFileFromFolderWithArtifactId(File folder, String artifactId) throws IOException
folder - the folder to look inartifactId - the artifactid in the properties of the (@code
MavenJarFile) in the folderMavenJarFile with the given artifactid,
can be nullIOExceptionpublic File writeStreamToDisk(InputStream in, String name, File outputLocationFolder) throws FileNotFoundException, IOException
in - the stream to write to diskname - the name the file that will be createdoutputLocationFolder - the location to write toFileNotFoundExceptionIOExceptionCopyright © 2014. All rights reserved.