Package org.jboss.profileservice.persistence.repository.metadata

Examples of org.jboss.profileservice.persistence.repository.metadata.AttachmentMetaData


      {
         attachments = new ArrayList<AttachmentMetaData>();
         repositoryMetaData.setAttachments(attachments);
      }
      // Extract the attachment
      AttachmentMetaData attachment = null;
      for(AttachmentMetaData a : attachments)
      {
         if(attachmentName.equals(a.getName()))
            attachment = a;
      }

      // Create a new one
      if(attachment == null)
      {
         // Create attachment meta data
         attachment = new AttachmentMetaData();
         // Add attachment meta data
         attachments.add(attachment);
      }

      // Is attachmentName the same as the className ?
      attachment.setName(attachmentName);
      attachment.setClassName(managedObject.getAttachment().getClass().getName());

      // Save the attachment
      String attachmentPath = deploymentPath + attachment.getName();
      // Create the persistence information
      PersistenceRoot persistenceRoot = getSerializer().loadAttachment(attachmentPath, PersistenceRoot.class);
      //
      persistenceRoot = createPersistedMetaData(persistenceRoot, managedObject, component, remove);
      // Serialize the attachment
      getSerializer().saveAttachment(attachmentPath, persistenceRoot);

      // Update the last modified.
      long lastModified = System.currentTimeMillis();
      attachment.setLastModified(lastModified);
      repositoryMetaData.setLastModified(lastModified);

      //  Save the updated repository meta data
      getSerializer().saveAttachment(getMetaDataPathName(deploymentPath), repositoryMetaData);
   }
View Full Code Here

TOP

Related Classes of org.jboss.profileservice.persistence.repository.metadata.AttachmentMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.