com.compomics.software.autoupdater
Class FileDAO

java.lang.Object
  extended by com.compomics.software.autoupdater.FileDAO
Direct Known Subclasses:
GUIFileDAO, HeadlessFileDAO

public abstract class FileDAO
extends Object

Author:
Davy

Constructor Summary
FileDAO()
           
 
Method Summary
 boolean addShortcutAtDeskTop(MavenJarFile mavenJarFile)
           
 boolean addShortcutAtDeskTop(MavenJarFile mavenJarFile, String iconName)
           
abstract  boolean createDesktopShortcut(MavenJarFile file, String iconName, boolean deleteOldShortcut)
          creates a new Desktop Shortcut to the maven jar file
abstract  File getLocationToDownloadOnDisk(String targetDownloadFolder)
           
 MavenJarFile getMavenJarFileFromFolderWithArtifactId(File folder, String artifactId)
           
 File unGzipAndUntarFile(GZIPInputStream in, File fileLocationOnDiskToDownloadTo)
           
 File unzipFile(ZipFile in, File fileLocationOnDiskToDownloadTo)
           
 File writeStreamToDisk(InputStream in, String name, File outputLocationFolder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDAO

public FileDAO()
Method Detail

createDesktopShortcut

public abstract boolean createDesktopShortcut(MavenJarFile file,
                                              String iconName,
                                              boolean deleteOldShortcut)
                                       throws IOException
creates a new Desktop Shortcut to the maven jar file

Parameters:
file - the maven jarfile to make a shortcut to
iconName - the name of the icon file in the resources folder
deleteOldShortcut - if previous shortcuts containing the maven jar file artifact id should be removed
Throws:
IOException

addShortcutAtDeskTop

public boolean addShortcutAtDeskTop(MavenJarFile mavenJarFile)

addShortcutAtDeskTop

public boolean addShortcutAtDeskTop(MavenJarFile mavenJarFile,
                                    String iconName)

getLocationToDownloadOnDisk

public abstract File getLocationToDownloadOnDisk(String targetDownloadFolder)
                                          throws IOException
Parameters:
targetDownloadFolder -
Returns:
Throws:
IOException

unzipFile

public File unzipFile(ZipFile in,
                      File fileLocationOnDiskToDownloadTo)
               throws IOException
Throws:
IOException

unGzipAndUntarFile

public File unGzipAndUntarFile(GZIPInputStream in,
                               File fileLocationOnDiskToDownloadTo)
                        throws IOException
Throws:
IOException

getMavenJarFileFromFolderWithArtifactId

public MavenJarFile getMavenJarFileFromFolderWithArtifactId(File folder,
                                                            String artifactId)
                                                     throws IOException
Throws:
IOException

writeStreamToDisk

public File writeStreamToDisk(InputStream in,
                              String name,
                              File outputLocationFolder)
                       throws FileNotFoundException,
                              IOException
Throws:
FileNotFoundException
IOException


Copyright © 2013. All Rights Reserved.