|
2.9.1: 2008-12-18 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.clients.migrate.Manager
net.sf.basedb.clients.migrate.Transfer
net.sf.basedb.clients.migrate.SharedItemTransfer
net.sf.basedb.clients.migrate.CommonItemTransfer
net.sf.basedb.clients.migrate.FileTransfer
abstract class FileTransfer
This class provides methods to transfer base 1 items that correspond to the File object in BASE 2.
Field Summary | |
---|---|
private static Pattern |
forbiddenCharacters
|
private static Logger |
log
Logger for this class |
protected boolean |
VERIFY_MD5
Indicates wether MD5 should be calculated or not. |
Fields inherited from class net.sf.basedb.clients.migrate.CommonItemTransfer |
---|
DESCRIPTION, NAME, REMOVED |
Fields inherited from class net.sf.basedb.clients.migrate.SharedItemTransfer |
---|
GID, GROUP_ACCESS, groupT, ID, OWNER, userT, WORLD_ACCESS |
Fields inherited from class net.sf.basedb.clients.migrate.Transfer |
---|
BASE2, FROM, itemList, LIMIT, LOCAL_MYSQL_TRANSFER, mapIds, progress, properties, QUICK_TRANSFER, selectOffset, sessionControl, TO |
Constructor Summary | |
---|---|
FileTransfer(UserTransfer userT,
GroupTransfer groupT)
Constructs a new FileTransfer. |
Method Summary | |
---|---|
protected File |
getExistingFile(User owner,
String fileName,
String location)
Returns an existing file if the name and md5sum matches a file already in the database. |
protected String |
md5sum(File file)
Calculates MD5sum for a file |
protected String |
md5sum(String fileLocation)
Returns the md5sum for a file specified by the fileLocation. |
protected static String |
replaceForbiddenCharacters(String in,
String replacement)
Replaces forbidden characters for file or directory names. |
protected void |
setCommonItemData(DbControl dc,
File file,
ResultSet rs)
Sets common item data for File objects. |
protected void |
transferFile(File file,
String theOldBase1File,
String md5)
Physically transfers a file. |
Methods inherited from class net.sf.basedb.clients.migrate.CommonItemTransfer |
---|
setCommonItemData |
Methods inherited from class net.sf.basedb.clients.migrate.SharedItemTransfer |
---|
chmod, chown, getOwner, setSharedItemData |
Methods inherited from class net.sf.basedb.clients.migrate.Transfer |
---|
cleanUpMemory, commit, createItem, createItem, dependencyFailure, done, getBase2Id, getBatchSize, getCount, getDependencyStatus, getIdMap, getInt, getProperty, initIdMap, isDone, mapId, newDbControl, readRestorePointData, run, run, runUnBatched, saveItem, setup, start, startProgress, writeRestorePointData |
Methods inherited from class net.sf.basedb.clients.migrate.Manager |
---|
getPreparedStatements, prepareStatementFromFile, print, printDate, setPreparedStatements, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean VERIFY_MD5
private static final Logger log
private static Pattern forbiddenCharacters
Constructor Detail |
---|
FileTransfer(UserTransfer userT, GroupTransfer groupT)
userT
- A finished UserTransfer
groupT
- A finished GroupTransfer
Method Detail |
---|
protected void transferFile(File file, String theOldBase1File, String md5)
file
- File
in BASE 2 used for uploadtheOldBase1File
- Full path to the base 1 filemd5
- Calculated md5sum of theOldBase1Filemd5sum(String)
protected String md5sum(File file)
file
- java.io.File
to calculate the md5sum on
protected String md5sum(String fileLocation)
fileLocation
- String e.g. "/tmp/file.tif"
protected static String replaceForbiddenCharacters(String in, String replacement)
protected File getExistingFile(User owner, String fileName, String location)
owner
- User
that might already have this file.fileName
- Name of the file including suffix. e.g. A123file.txtlocation
- A complete path to the base 1 file.
protected void setCommonItemData(DbControl dc, File file, ResultSet rs)
dc
- file
- File for which to set the datars
- ResultSet containing data for the current file
|
2.9.1: 2008-12-18 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |