diff --git a/src/main/java/org/olat/core/commons/modules/bc/meta/MetaInfo.java b/src/main/java/org/olat/core/commons/modules/bc/meta/MetaInfo.java index b1e343e5047e624642190212897408d72fc6eb81..2909533baa79fa3c44159731eb1de0df7dceb449 100644 --- a/src/main/java/org/olat/core/commons/modules/bc/meta/MetaInfo.java +++ b/src/main/java/org/olat/core/commons/modules/bc/meta/MetaInfo.java @@ -89,6 +89,8 @@ public interface MetaInfo { * @return The identity of the initial author. */ public Identity getAuthorIdentity(); + + public boolean hasAuthorIdentity(); /** * Corresponds to DublinCore:description @@ -200,6 +202,9 @@ public interface MetaInfo { public VFSLeaf getThumbnail(int maxWidth, int maxHeight); + /** + * Thumbnails are cleared and the metadata file is written on the disk + */ public void clearThumbnails(); /** diff --git a/src/main/java/org/olat/core/commons/modules/bc/meta/MetaInfoFileImpl.java b/src/main/java/org/olat/core/commons/modules/bc/meta/MetaInfoFileImpl.java index a9f4e787b2cac99cc7480dccd2e4d89c80bb4cf1..ec25998cd184262ac053e23d82ef634df5d92559 100644 --- a/src/main/java/org/olat/core/commons/modules/bc/meta/MetaInfoFileImpl.java +++ b/src/main/java/org/olat/core/commons/modules/bc/meta/MetaInfoFileImpl.java @@ -561,13 +561,18 @@ public class MetaInfoFileImpl extends DefaultHandler implements MetaInfo { * @see org.olat.core.commons.modules.bc.meta.MetaInfo#getAuthorIdentity() */ public Identity getAuthorIdentity() { - if (this.authorIdentKey == null) { + if (authorIdentKey == null) { return null; } else { - return BaseSecurityManager.getInstance().loadIdentityByKey(this.authorIdentKey); + return BaseSecurityManager.getInstance().loadIdentityByKey(authorIdentKey); } } + @Override + public boolean hasAuthorIdentity() { + return (authorIdentKey != null); + } + /** * @see org.olat.core.commons.modules.bc.meta.MetaInfo#getHTMLFormattedAuthor() */ @@ -808,6 +813,9 @@ public class MetaInfoFileImpl extends DefaultHandler implements MetaInfo { return new LocalFileImpl(thumbnailInfo.getThumbnailFile()); } + /** + * Thumbnails are cleared and the XML file is written on the disk + */ @Override public void clearThumbnails() { cannotGenerateThumbnail = false; diff --git a/src/main/java/org/olat/core/commons/services/webdav/manager/VFSResourceRoot.java b/src/main/java/org/olat/core/commons/services/webdav/manager/VFSResourceRoot.java index 2c4cd1294a67adff37b781df2222d80198d72064..0e47b713deacd3f03903cb0aa742fc66afc4aa55 100644 --- a/src/main/java/org/olat/core/commons/services/webdav/manager/VFSResourceRoot.java +++ b/src/main/java/org/olat/core/commons/services/webdav/manager/VFSResourceRoot.java @@ -208,7 +208,6 @@ public class VFSResourceRoot implements WebResourceRoot { } try { - //FileUtils.copy(is, childLeaf.getOutputStream(false)); copyVFS(childLeaf, is); } catch (QuotaExceededException e) { throw e; @@ -228,10 +227,10 @@ public class VFSResourceRoot implements WebResourceRoot { if(childLeaf instanceof MetaTagged && identity != null) { MetaInfo infos = ((MetaTagged)childLeaf).getMetaInfo(); - if(infos != null && infos.getAuthorIdentity() == null) { + if(infos != null && !infos.hasAuthorIdentity()) { infos.setAuthor(identity); infos.clearThumbnails(); - infos.write(); + //infos.write(); the clearThumbnails call write() } }