org.formaria.resource
Class ResourceLoader

java.lang.Object
  extended by org.formaria.resource.ResourceLoader

public class ResourceLoader
extends java.lang.Object

A dynamic loader of resources from a URL.

Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.


Field Summary
static int DOCUMENT_FILESIZE
           
static int DOWNLOAD_FILEDATE
           
static int DOWNLOAD_FILENAME
           
static int DOWNLOAD_ID
           
static int DOWNLOAD_PROGRESS
           
 
Constructor Summary
protected ResourceLoader(Project project)
          Creates a new instance of DocumentManager
 
Method Summary
 java.lang.ClassLoader getClassloader()
           
static ResourceLoader getInstance(Project project)
           
 java.lang.String getSourceFileName(java.lang.String fileName)
          Get the complete server URL of the file
 java.io.File getTargetFile(java.lang.String fileName, boolean makeDirs)
          Get the complete target filename
 void pauseDownload()
           
 void setServerURL(java.lang.String url)
          Fixup the server URL
 void setTargetFolder(java.io.File folder)
          Fixup the target folder
 void startCacheCheck(BaseModel fileList, java.io.File outputFolder)
          Start the download service
 void startDownload(BaseModel fileList, java.lang.String downloadServer, java.io.File outputFolder, ResourceLoaderStatus status)
          Start the download service
 void stopDownload()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOWNLOAD_FILENAME

public static final int DOWNLOAD_FILENAME
See Also:
Constant Field Values

DOWNLOAD_ID

public static final int DOWNLOAD_ID
See Also:
Constant Field Values

DOCUMENT_FILESIZE

public static final int DOCUMENT_FILESIZE
See Also:
Constant Field Values

DOWNLOAD_FILEDATE

public static final int DOWNLOAD_FILEDATE
See Also:
Constant Field Values

DOWNLOAD_PROGRESS

public static final int DOWNLOAD_PROGRESS
See Also:
Constant Field Values
Constructor Detail

ResourceLoader

protected ResourceLoader(Project project)
Creates a new instance of DocumentManager

Method Detail

getInstance

public static ResourceLoader getInstance(Project project)

getClassloader

public java.lang.ClassLoader getClassloader()

startCacheCheck

public void startCacheCheck(BaseModel fileList,
                            java.io.File outputFolder)
Start the download service


startDownload

public void startDownload(BaseModel fileList,
                          java.lang.String downloadServer,
                          java.io.File outputFolder,
                          ResourceLoaderStatus status)
Start the download service


stopDownload

public void stopDownload()

pauseDownload

public void pauseDownload()

getSourceFileName

public java.lang.String getSourceFileName(java.lang.String fileName)
Get the complete server URL of the file


getTargetFile

public java.io.File getTargetFile(java.lang.String fileName,
                                  boolean makeDirs)
Get the complete target filename


setServerURL

public void setServerURL(java.lang.String url)
Fixup the server URL


setTargetFolder

public void setTargetFolder(java.io.File folder)
Fixup the target folder