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,
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)
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, boolean deleteOldShortcut) throws IOException
file
- the maven jarfile to make a shortcut toiconName
- the name of the icon file in the resources folderdeleteOldShortcut
- if previous shortcuts containing the maven jar
file artifact id should be removedIOException
public 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
RuntimeException
public abstract File getLocationToDownloadOnDisk(String targetDownloadFolder) throws IOException
targetDownloadFolder
- first place to check if it is a possible
download locationIOException
public boolean unzipFile(ZipFile zip, File fileLocationOnDiskToDownloadTo) throws IOException
zip
- the zipfile to unzipfileLocationOnDiskToDownloadTo
- the folder to unzip inIOException
public boolean unGzipAndUntarFile(GZIPInputStream in, File fileLocationOnDiskToDownloadTo) throws IOException
in
- a GZIPInputStream
of the file that needs to be
ungzipped and untarredfileLocationOnDiskToDownloadTo
- the folder to ungzip and untar inIOException
public 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
public 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
IOException
Copyright © 2013. All Rights Reserved.