public class AttachmentMgr
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DOCTYPE_ATTACHMENTS |
static java.lang.String |
DOCTYPE_DIAGRAMS |
static java.lang.String |
DOCTYPE_IMAGES |
static java.lang.String |
FIELD_ADDINFO |
static java.lang.String |
FIELD_DESCRIPTION |
static java.lang.String |
FIELD_DOCINFOID |
static java.lang.String |
FIELD_DOCTYPE |
static java.lang.String |
FIELD_DOCUMENT |
static java.lang.String |
FIELD_GETLATESTVERSION |
static java.lang.String |
FIELD_NEWURLNAME |
static java.lang.String |
FIELD_OWNERTABLE |
static java.lang.String |
FIELD_PRINTTHRULINK |
static java.lang.String |
FIELD_PRINTTHRULINKDFLT |
static java.lang.String |
FIELD_URLNAME |
static java.lang.String |
FIELD_URLTYPE |
static java.lang.String |
FIELD_WEBURL |
static int |
FILE_DOES_NOT_EXIST |
static int |
FILE_EXISTS_AND_DOES_NOT_MATCH |
static int |
FILE_EXISTS_AND_MATCHES |
static java.lang.String |
PROP_ALLOWED_EXTENSIONS |
static java.lang.String |
PROP_DEF_PATH |
static java.lang.String |
PROP_MAX_FILE_SIZE |
static java.lang.String |
PROP_PRINT_WITH_REPORT |
static java.lang.String |
RELATIONSHIP_DOCINFO |
static java.lang.String |
RELATIONSHIP_DOCLINKS |
static java.lang.String |
TABLE_DOCINFO |
static java.lang.String |
URL_TYPE_FILE |
Constructor and Description |
---|
AttachmentMgr(ProgressLogger<ItemFACILITY> logger,
MboRemote projectMbo) |
Modifier and Type | Method and Description |
---|---|
void |
copyFile(Item item,
java.lang.String source,
java.lang.String destination) |
void |
copyFile(java.lang.String source,
java.lang.String destination)
Copies a file from the source file name to the destination file name
|
void |
deleteFiles()
Delete all the files that were successfully cipied.
|
MboRemote |
findDocInfo(java.lang.String maximoFileName,
java.lang.String docName)
Find a DocInfo record for a fully qualified filename.
|
java.lang.String[] |
getAllowedExtensions() |
java.lang.String |
getAttachmentFileName(Item item,
ItemDOCUMENT doc) |
long |
getMaxFileSize() |
static java.lang.String |
getMD5Checksum(java.lang.String filename) |
java.lang.String |
getOwningTable(Item item) |
java.lang.String |
getPathForDocType(java.lang.String name) |
java.lang.String |
getProjectDocDir() |
java.lang.String |
getRootDir() |
boolean |
isPrintWithReport() |
int |
testFileMatch(java.lang.String cobieFileName,
java.lang.String maximoFileName)
Test if a maximo attachment file exists with the same name as the new attachment,
and if there is, if there files have the same MD5 checksum.
|
public static final java.lang.String PROP_MAX_FILE_SIZE
public static final java.lang.String PROP_DEF_PATH
public static final java.lang.String PROP_ALLOWED_EXTENSIONS
public static final java.lang.String PROP_PRINT_WITH_REPORT
public static final java.lang.String TABLE_DOCINFO
public static final java.lang.String RELATIONSHIP_DOCINFO
public static final java.lang.String RELATIONSHIP_DOCLINKS
public static final java.lang.String FIELD_DESCRIPTION
public static final java.lang.String FIELD_DOCINFOID
public static final java.lang.String FIELD_DOCUMENT
public static final java.lang.String FIELD_DOCTYPE
public static final java.lang.String FIELD_NEWURLNAME
public static final java.lang.String FIELD_PRINTTHRULINKDFLT
public static final java.lang.String FIELD_PRINTTHRULINK
public static final java.lang.String FIELD_URLNAME
public static final java.lang.String FIELD_URLTYPE
public static final java.lang.String FIELD_WEBURL
public static final java.lang.String FIELD_ADDINFO
public static final java.lang.String FIELD_OWNERTABLE
public static final java.lang.String FIELD_GETLATESTVERSION
public static final java.lang.String DOCTYPE_ATTACHMENTS
public static final java.lang.String DOCTYPE_DIAGRAMS
public static final java.lang.String DOCTYPE_IMAGES
public static final java.lang.String URL_TYPE_FILE
public static final int FILE_DOES_NOT_EXIST
public static final int FILE_EXISTS_AND_MATCHES
public static final int FILE_EXISTS_AND_DOES_NOT_MATCH
public AttachmentMgr(ProgressLogger<ItemFACILITY> logger, MboRemote projectMbo) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
public java.lang.String getOwningTable(Item item)
public java.lang.String getPathForDocType(java.lang.String name)
public java.lang.String getRootDir()
public java.lang.String getProjectDocDir()
public java.lang.String[] getAllowedExtensions()
public long getMaxFileSize()
public boolean isPrintWithReport()
public java.lang.String getAttachmentFileName(Item item, ItemDOCUMENT doc)
public int testFileMatch(java.lang.String cobieFileName, java.lang.String maximoFileName) throws java.security.NoSuchAlgorithmException, java.io.IOException
cobieFileName
- maximoFileName
- java.security.NoSuchAlgorithmException
java.io.IOException
public void copyFile(Item item, java.lang.String source, java.lang.String destination)
public void copyFile(java.lang.String source, java.lang.String destination) throws java.io.IOException
source
- destination
- java.io.IOException
public void deleteFiles()
public MboRemote findDocInfo(java.lang.String maximoFileName, java.lang.String docName) throws java.rmi.RemoteException, MXException
maximoFileName
- Fully qualified name of existing maximo attachment filedocName
- java.rmi.RemoteException
MXException
public static java.lang.String getMD5Checksum(java.lang.String filename) throws java.io.IOException, java.security.NoSuchAlgorithmException
java.io.IOException
java.security.NoSuchAlgorithmException