public void register( final FileRecord fileRecord ) { Serializable fileId = UUID.randomUUID().toString(); fileRecord.setFile( new RepositoryFile.Builder( fileRecord.getFile() ).id( fileId ).build() ); fileRecord.setAcl( new RepositoryFileAcl.Builder( fileRecord.getAcl() ).id( fileId ).build() ); idMap.put( fileId, fileRecord ); }
/** * Creates a {@code RepositoryFile}. If {@code fromRepo} is {@code true}, then it is populated as if it had been * returned from the repository (e.g. non-null ID). */ public static RepositoryFile makeFileObject( final String path, final boolean fromRepo ) { final String fileName = StringUtils.substringAfterLast( path, RepositoryFile.SEPARATOR ); RepositoryFile.Builder b = new RepositoryFile.Builder( fileName ); // files returned from repo have non-null id and path properties if ( fromRepo ) { b.id( makeIdObject( path ) ).path( path ); } return b.build(); }
new RepositoryFile.Builder( file ).versionId( file.getVersionId() ).id( file.getId() ).title( RepositoryFile.DEFAULT_LOCALE, databaseConnection.getName() ).build(); file =
public Builder( final RepositoryFile other ) { this( other.getName() ); synchronized ( other ) { this.id( other.getId() ).path( other.getPath() ).createdDate( other.getCreatedDate() ).creatorId( other.getCreatorId() ).fileSize( other.getFileSize() ).folder( other.isFolder() ).lastModificationDate( other.getLastModifiedDate() ).versioned( other.isVersioned() ).hidden( other.isHidden() ).schedulable( other.isSchedulable() ).versionId( other.getVersionId() ).locked( other.isLocked() ).lockDate( other.getLockDate() ).lockOwner( other.getLockOwner() ).lockMessage( other.getLockMessage() ).title( other.getTitle() ).description( other.getDescription() ).locale( other.getLocale() ).originalParentFolderPath( other.getOriginalParentFolderPath() ).deletedDate( other.getDeletedDate() ).localePropertiesMap( other.getLocalePropertiesMap() ).aclNode( other.isAclNode() ); } }