|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.software.autoupdater.FileDAO
public abstract class FileDAO
FileDAO file access.
Constructor Summary | |
---|---|
FileDAO()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileDAO()
Method Detail |
---|
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 removed
IOException
public boolean addShortcutAtDeskTop(MavenJarFile mavenJarFile)
mavenJarFile
- the maven jar file
public 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 to
NullPointerException
RuntimeException
public abstract File getLocationToDownloadOnDisk(String targetDownloadFolder) throws IOException
targetDownloadFolder
- first place to check if it is a possible
download location
IOException
public boolean unzipFile(ZipFile zip, File fileLocationOnDiskToDownloadTo) throws IOException
zip
- the zipfile to unzipfileLocationOnDiskToDownloadTo
- the folder to unzip in
IOException
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 in
IOException
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 folder
MavenJarFile
with the given artifactid, can be null
IOException
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 to
FileNotFoundException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |