public abstract class FileDAO
extends java.lang.Object
| Constructor and Description |
|---|
FileDAO() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addShortcutAtDeskTop(MavenJarFile mavenJarFile)
Add desktop shortcut.
|
boolean |
addShortcutAtDeskTop(MavenJarFile mavenJarFile,
java.lang.String iconName)
Adds a shortcut to the desktop.
|
abstract boolean |
createDesktopShortcut(MavenJarFile file,
java.lang.String iconName,
boolean deleteOldShortcut)
Creates a new Desktop Shortcut to the maven jar file, atm windows only.
|
abstract java.io.File |
getLocationToDownloadOnDisk(java.lang.String targetDownloadFolder)
Try to find an at least somewhat sane location to download files to.
|
MavenJarFile |
getMavenJarFileFromFolderWithArtifactId(java.io.File folder,
java.lang.String artifactId)
Fetches a maven built jar file from a folder for the given artifact id
(e.g peptideshaker or ms-lims).
|
boolean |
unGzipAndUntarFile(java.util.zip.GZIPInputStream in,
java.io.File fileLocationOnDiskToDownloadTo)
Untars and ungzips a .tar.gz file.
|
boolean |
unzipFile(java.util.zip.ZipFile zip,
java.io.File fileLocationOnDiskToDownloadTo)
Unzips a zip archive.
|
java.io.File |
writeStreamToDisk(java.io.InputStream in,
java.lang.String name,
java.io.File outputLocationFolder)
Writes a stream to disk.
|
public abstract boolean createDesktopShortcut(MavenJarFile file, java.lang.String iconName, boolean deleteOldShortcut) throws java.io.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 removedjava.io.IOExceptionpublic boolean addShortcutAtDeskTop(MavenJarFile mavenJarFile)
mavenJarFile - the maven jar filepublic boolean addShortcutAtDeskTop(MavenJarFile mavenJarFile, java.lang.String iconName) throws java.lang.NullPointerException, java.lang.RuntimeException
mavenJarFile - the MavenJarFile to create the shortcut foriconName - the name of the icon in the resource folder of the
MavenJarFile to link tojava.lang.NullPointerExceptionjava.lang.RuntimeExceptionpublic abstract java.io.File getLocationToDownloadOnDisk(java.lang.String targetDownloadFolder)
throws java.io.IOException
targetDownloadFolder - first place to check if it is a possible
download locationjava.io.IOExceptionpublic boolean unzipFile(java.util.zip.ZipFile zip,
java.io.File fileLocationOnDiskToDownloadTo)
throws java.io.IOException
zip - the zipfile to unzipfileLocationOnDiskToDownloadTo - the folder to unzip injava.io.IOExceptionpublic boolean unGzipAndUntarFile(java.util.zip.GZIPInputStream in,
java.io.File fileLocationOnDiskToDownloadTo)
throws java.io.IOException
in - a GZIPInputStream of the file that needs to be
ungzipped and untarredfileLocationOnDiskToDownloadTo - the folder to ungzip and untar injava.io.IOExceptionpublic MavenJarFile getMavenJarFileFromFolderWithArtifactId(java.io.File folder, java.lang.String artifactId) throws java.io.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 nulljava.io.IOExceptionpublic java.io.File writeStreamToDisk(java.io.InputStream in,
java.lang.String name,
java.io.File outputLocationFolder)
throws java.io.FileNotFoundException,
java.io.IOException
in - the stream to write to diskname - the name the file that will be createdoutputLocationFolder - the location to write tojava.io.FileNotFoundExceptionjava.io.IOExceptionCopyright © 2014. All Rights Reserved.