|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.fh_mannheim.mm.dms.framework.UploadManager
UploadManager loads files to the server and connects to the database.
| Constructor Summary | |
UploadManager(Config cfg)
Constructor. |
|
| Method Summary | |
boolean |
addHit(int nUploadID)
Add hits of this file. |
boolean |
addUpload(Upload upload)
Add new upload order. |
boolean |
addUpload(Upload upload,
boolean bForceUpdate)
Add new upload order. |
boolean |
addUpload(Upload upload,
java.io.BufferedInputStream is,
boolean bForceUpdate)
Add new upload order and copy filestream to upload destination. |
boolean |
addUpload(Upload upload,
java.lang.String strFilename,
boolean bForceUpdate)
Add new upload order and copy local file to upload destination. |
boolean |
checkInUpload(int nID)
Move upload order to file database. |
boolean |
checkInUpload(Upload upload)
Move upload order to file database. |
int |
deleteMissingFiles()
Delete all records, where file is missing. |
boolean |
deleteUpload(int nID)
Delete an upload order. |
boolean |
deleteUpload(int nID,
boolean bDeleteFile)
Delete an upload order. |
boolean |
existsFile(java.lang.String strFilename)
Test if a file exists. |
boolean |
existsFile(Upload upload)
Test if a file exists. |
boolean |
existsUpload(int nUploadID)
Check if upload exists. |
boolean |
existsUpload(java.lang.String strFilename)
Check if upload exists. |
boolean |
exportUploads(java.lang.String strFilename)
Export uploads to xml file. |
java.lang.String |
getAbsoluteFilename(java.lang.String strFilename)
Return filename with path on the server. |
java.util.ArrayList |
getAllFilenames()
Get all files by filename. |
java.util.ArrayList |
getAllFilenames(boolean bScheduledUploadsToo)
Get all files by filename. |
UploadList |
getAllFiles()
Get all files but not the scheduled uploads. |
UploadList |
getAllFiles(boolean bScheduledUploadsToo)
Get all files. |
UploadList |
getAllFilesByAuthor(int nAuthorID)
Get all files but not the scheduled uploads. |
UploadList |
getAllFilesByAuthor(int nAuthorID,
boolean bScheduledUploadsToo)
Get all files of an author. |
UploadList |
getAllFilesByCategory(int nCategoryID)
Get all files of a category. |
java.util.ArrayList |
getAllScheduledUploadFilenames()
Get all scheduled upload orders by filename. |
UploadList |
getAllScheduledUploads()
Get all scheduled upload orders. |
UploadList |
getAllScheduledUploadsByAuthor(int nAuthorID)
Get all scheduled upload orders of an author. |
int |
getFileHits(int nUploadID)
Count hits of this file. |
double |
getFileHitsPerMonth(int nUploadID)
Count hitrate of this file. |
int |
getFileNum()
Count all files. |
int |
getFileNum(int nAuthorID)
Count all files of an author. |
FileSize |
getFileSize(java.lang.String strFilename)
Get the size in bytes of a file. |
FormattedDate |
getLastHit(int nUserID,
int nFileID)
Get the last acces of a upload by a user. |
Upload |
getNextScheduledUpload()
Get first upload order. |
Upload |
getNextScheduledUpload(int nID)
Get next upload order. |
java.lang.String |
getRelativeFilename(java.lang.String strFilename,
int nUserID,
boolean bExtractFilename)
Return filename with relative path on the server. |
java.lang.String |
getRelativeFilename(java.lang.String strFilename,
java.lang.String strBasePath)
Return filename with relative path on the server. |
java.lang.String |
getRelativeFilename(java.lang.String strFilename,
java.lang.String strBasePath,
int nUserID)
Return filename with relative path on the server. |
int |
getScheduledUploadNum()
Count all scheduled upload orders. |
int |
getScheduledUploadNum(int nAuthorID)
Count all scheduled upload orders of an author. |
int |
getSystemFileNum()
Count all files. |
FileSize |
getSystemSize()
Get the size in bytes of all files. |
Upload |
getUpload(int nID)
Get an upload order. |
Upload |
getUpload(java.lang.String strFilename)
Get an upload order. |
int |
importFiles(java.lang.String strFilename)
Import uploads from xml file.. |
int |
importFiles(java.lang.String strPath,
java.lang.String strExtension,
int nUserID,
boolean bSearchSubdirs,
boolean bForceUpdate)
Search all files and check them in. |
int |
importFiles(java.lang.String strPath,
java.lang.String strBasePath,
java.lang.String strExtension,
int nUserID,
boolean bSearchSubdirs,
boolean bForceUpdate)
Search all files and check them in. |
org.w3c.dom.Document |
produceReport()
Generate xml document. |
boolean |
scheduleAllUploads()
Move all uploads to upload database. |
boolean |
scheduleUpload(int nID)
Move upload order to upload database. |
boolean |
scheduleUpload(Upload upload)
Move upload order to upload database. |
int |
sendUpdateNotifierMails(Upload upload)
Send informationmails to watching users of this file. |
org.w3c.dom.Element |
toElement(org.w3c.dom.Document doc)
Write information of uploads in a xml element. |
org.w3c.dom.Element |
toElement(org.w3c.dom.Element element,
org.w3c.dom.Document doc)
Write information of uploads in a xml element. |
java.lang.String |
toString()
Write information of files in a string. |
boolean |
updateUpload(Upload editedUpload)
Update an existing upload. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public UploadManager(Config cfg)
cfg - Config| Method Detail |
public boolean addHit(int nUploadID)
nUploadID - ID of file
public boolean addUpload(Upload upload)
throws DuplicateUploadException
upload - Order, which should be prepared
DuplicateUploadException
public boolean addUpload(Upload upload,
boolean bForceUpdate)
throws DuplicateUploadException
upload - Order, which should be preparedbForceUpdate - Overwrite existing upload
DuplicateUploadException
public boolean addUpload(Upload upload,
java.io.BufferedInputStream is,
boolean bForceUpdate)
throws DuplicateUploadException,
InvalidFileTypeException,
java.io.IOException
upload - Order, which should be preparedis - FilestreambForceUpdate - Overwrite existing upload
DuplicateUploadException
java.io.IOException
InvalidFileTypeException
public boolean addUpload(Upload upload,
java.lang.String strFilename,
boolean bForceUpdate)
throws DuplicateUploadException,
InvalidFileTypeException,
java.io.IOException
upload - Order, which should be preparedstrFilename - File, which should be copiedbForceUpdate - Overwrite existing upload
DuplicateUploadException
java.io.IOException
InvalidFileTypeExceptionpublic boolean checkInUpload(int nID)
nID - ID of upload order
public boolean checkInUpload(Upload upload)
upload - Order, which should be prepared
public int deleteMissingFiles()
public boolean deleteUpload(int nID)
nID - ID of upload
public boolean deleteUpload(int nID,
boolean bDeleteFile)
nID - ID of uploadbDeleteFile - Should file be deleted too
public boolean existsFile(java.lang.String strFilename)
strFilename - Filename
public boolean existsFile(Upload upload)
upload - Upload, which should be checked
public boolean existsUpload(int nUploadID)
nUploadID - ID of upload
public boolean existsUpload(java.lang.String strFilename)
strFilename - Filename of upload
public boolean exportUploads(java.lang.String strFilename)
throws java.io.IOException
strFilename - Filename of xml file
java.io.IOException - When file could not be savedpublic java.lang.String getAbsoluteFilename(java.lang.String strFilename)
strFilename - Filename of upload
public java.util.ArrayList getAllFilenames()
public java.util.ArrayList getAllFilenames(boolean bScheduledUploadsToo)
bScheduledUploadsToo - Should the scheduled uploads be added too
public UploadList getAllFiles()
public UploadList getAllFiles(boolean bScheduledUploadsToo)
bScheduledUploadsToo - Should the scheduled uploads be added too
public UploadList getAllFilesByAuthor(int nAuthorID)
public UploadList getAllFilesByAuthor(int nAuthorID,
boolean bScheduledUploadsToo)
nAuthorID - ID of authorbScheduledUploadsToo - Should the scheduled uploads be added too
public UploadList getAllFilesByCategory(int nCategoryID)
nCategoryID - ID of category
public java.util.ArrayList getAllScheduledUploadFilenames()
public UploadList getAllScheduledUploads()
public UploadList getAllScheduledUploadsByAuthor(int nAuthorID)
nAuthorID - ID of author
public int getFileHits(int nUploadID)
nUploadID - ID of file
public double getFileHitsPerMonth(int nUploadID)
nUploadID - ID of file
public int getFileNum()
public int getFileNum(int nAuthorID)
nAuthorID - ID of author
public FileSize getFileSize(java.lang.String strFilename)
strFilename - Filename
public FormattedDate getLastHit(int nUserID,
int nFileID)
public Upload getNextScheduledUpload()
public Upload getNextScheduledUpload(int nID)
nID - ID of current upload
public java.lang.String getRelativeFilename(java.lang.String strFilename,
int nUserID,
boolean bExtractFilename)
Example:
strFilename - Filename of uploadnUserID - ID of userbExtractFilename - Should only filename be added or complete path
public java.lang.String getRelativeFilename(java.lang.String strFilename,
java.lang.String strBasePath)
Example:
strFilename - Filename of uploadstrBasePath - Rootpath
public java.lang.String getRelativeFilename(java.lang.String strFilename,
java.lang.String strBasePath,
int nUserID)
Example:
strFilename - Filename of uploadstrBasePath - RootpathnUserID - ID of user
public int getScheduledUploadNum()
public int getScheduledUploadNum(int nAuthorID)
nAuthorID - ID of author
public int getSystemFileNum()
public FileSize getSystemSize()
public Upload getUpload(int nID)
nID - ID of upload
public Upload getUpload(java.lang.String strFilename)
strFilename - Filename of upload
public int importFiles(java.lang.String strPath,
java.lang.String strExtension,
int nUserID,
boolean bSearchSubdirs,
boolean bForceUpdate)
strPath - Path to be searchedstrExtension - Filetype which should be foundnUserID - ID of userbSearchSubdirs - Should subdiretories be searched toobForceUpdate - Overwrite existing upload
public int importFiles(java.lang.String strPath,
java.lang.String strBasePath,
java.lang.String strExtension,
int nUserID,
boolean bSearchSubdirs,
boolean bForceUpdate)
strPath - Path to be searchedstrBasePath - Rootpath to be searchedstrExtension - Filetype which should be foundnUserID - ID of userbSearchSubdirs - Should subdiretories be searched toobForceUpdate - Overwrite existing uploadpublic int importFiles(java.lang.String strFilename)
strFilename - Filename of xmlfile
public org.w3c.dom.Document produceReport()
produceReport in interface IProducerpublic org.w3c.dom.Element toElement(org.w3c.dom.Document doc)
toElement in interface IElementdoc - XML Document
public org.w3c.dom.Element toElement(org.w3c.dom.Element element,
org.w3c.dom.Document doc)
toElement in interface IElementelement - Root elementdoc - XML Document
public boolean scheduleAllUploads()
public boolean scheduleUpload(int nID)
nID - ID of upload order
public boolean scheduleUpload(Upload upload)
upload - Upload, which should be scheduled again
public int sendUpdateNotifierMails(Upload upload)
upload - Upload
public java.lang.String toString()
toString in interface IElementpublic boolean updateUpload(Upload editedUpload)
editedUpload - Order, which should be updated
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||