meta.setTags(auxiliaryTags); meta.setParentId(lastParent); Save2Operation saveOp = storageFacade.buildSaveOperation( currentPath, meta, null, null); lastParent = storageFacade.executeOperation(saveOp); meta.setTags(auxiliaryTags); meta.setParentId(localLastParent); Save2Operation saveOp = storageFacade.buildSaveOperation( currentYarFilePath, meta, null, null); localLastParent = storageFacade.executeOperation(saveOp);
/** * Registers single file content into given storage location using parent and tags. * Returns {@link YaddaObjectID} of registered document. * @param file * @param yarPath * @param parentId * @param tags * @return {@link YaddaObjectID} of registered document * @throws ServiceException * @throws FileNotFoundException */ protected YaddaObjectID registerFile(File file, String yarPath, YaddaObjectID parentId, String[] tags) throws ServiceException, FileNotFoundException { ArchiveObjectFacade currentPolicyMeta = new ArchiveObjectFacade(); currentPolicyMeta.setId(new YaddaObjectID(new UUIDGenerator().generate(null))); currentPolicyMeta.setType(ArchiveParamConstants.OBJECT_TYPE_FILE); currentPolicyMeta.setParentId(parentId); currentPolicyMeta.setTags(tags); currentPolicyMeta.addPart(predefinedPartType, predefinedMimeType, new FileInputStream(file)); StorageOperation currentOp = storageFacade.buildSaveOperation( yarPath, currentPolicyMeta, null, null); return storageFacade.executeOperation(currentOp); }