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 removedIOException
- if an IOException occurspublic 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 toNullPointerException
- if a NullPointerException occursRuntimeException
- if a RuntimeException occurspublic abstract File getLocationToDownloadOnDisk(String targetDownloadFolder) throws IOException
targetDownloadFolder
- first place to check if it is a possible
download locationIOException
- if an IOException occurspublic boolean unzipFile(ZipFile zip, File fileLocationOnDiskToDownloadTo) throws IOException
zip
- the zipfile to unzipfileLocationOnDiskToDownloadTo
- the folder to unzip inIOException
- if an IOException occurspublic 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 handlerIOException
- if an IOException occurspublic 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 nullIOException
- if an IOException occurspublic 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 toFileNotFoundException
- if a FileNotFoundException occursIOException
- if an IOException occursCopyright © 2016. All rights reserved.