示例#1
0
 /**
  * Adds file metadata to a file group in a mets document.
  *
  * @param groupName the group where the metadata is to add
  * @param url the file url
  * @param title the file title
  * @param mimetype the file mimetype
  */
 public void addFiletoFileGroup(String groupName, String url, String title, String mimetype) {
   FileGrp currentGroup = null;
   FileGrp[] fileGroups = this.fileSec.getFileGrpArray();
   for (int i = 0; i < fileGroups.length; i++) {
     if (fileGroups[i].getUSE().equals(groupName)) {
       currentGroup = fileGroups[i];
       break;
     }
   }
   FileType currentFile = currentGroup.addNewFile();
   currentFile.setMIMETYPE(mimetype);
   currentFile.setID(title);
   FLocat floc = currentFile.addNewFLocat();
   floc.setLOCTYPE(FLocat.LOCTYPE.URL);
   floc.setHref(url);
 }
示例#2
0
 /**
  * Creates a file Group element of a mets document.
  *
  * @param groupName the name of the file group
  */
 public void createFileGroup(String groupName) {
   FileGrp fileGrp = this.fileSec.addNewFileGrp();
   fileGrp.setUSE(groupName);
 }