psdi.app.bim.loader

Class AttachmentMgr

  • java.lang.Object
    • psdi.app.bim.loader.AttachmentMgr


  • public class AttachmentMgr
    extends java.lang.Object
    • Method Detail

      • getOwningTable

        public java.lang.String getOwningTable(Item item)
      • getPathForDocType

        public java.lang.String getPathForDocType(java.lang.String name)
      • getRootDir

        public java.lang.String getRootDir()
      • getProjectDocDir

        public java.lang.String getProjectDocDir()
      • getAllowedExtensions

        public java.lang.String[] getAllowedExtensions()
      • getMaxFileSize

        public long getMaxFileSize()
      • isPrintWithReport

        public boolean isPrintWithReport()
      • getAttachmentFileName

        public java.lang.String getAttachmentFileName(Item item,
                                                      ItemDOCUMENT doc)
      • testFileMatch

        public int testFileMatch(java.lang.String cobieFileName,
                                 java.lang.String maximoFileName)
                          throws java.security.NoSuchAlgorithmException,
                                 java.io.IOException
        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.
        Parameters:
        cobieFileName -
        maximoFileName -
        Returns:
        One of: FILE_DOES_NOT_EXIST, FILE_EXISTS_AND_DOES_NOT_MATCH, FILE_EXISTS_AND_MATCHES
        Throws:
        java.security.NoSuchAlgorithmException
        java.io.IOException
      • copyFile

        public void copyFile(Item item,
                             java.lang.String source,
                             java.lang.String destination)
      • copyFile

        public void copyFile(java.lang.String source,
                             java.lang.String destination)
                      throws java.io.IOException
        Copies a file from the source file name to the destination file name
        Parameters:
        source -
        destination -
        Throws:
        java.io.IOException
      • deleteFiles

        public void deleteFiles()
        Delete all the files that were successfully cipied. A file may be referenced multiple times so it cannot be deleted until the import has completed
      • findDocInfo

        public MboRemote findDocInfo(java.lang.String maximoFileName,
                                     java.lang.String docName)
                              throws java.rmi.RemoteException,
                                     MXException
        Find a DocInfo record for a fully qualified filename. If there are multiple matches, try and match the document name, but just return the first if there is not a match.
        Parameters:
        maximoFileName - Fully qualified name of existing maximo attachment file
        docName -
        Returns:
        Null or the matching DocInfo Mbo
        Throws:
        java.rmi.RemoteException
        MXException
      • getMD5Checksum

        public static java.lang.String getMD5Checksum(java.lang.String filename)
                                               throws java.io.IOException,
                                                      java.security.NoSuchAlgorithmException
        Throws:
        java.io.IOException
        java.security.NoSuchAlgorithmException