diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java index 661b3cda448..74f99416db7 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java @@ -893,24 +893,18 @@ public long findStorageSize(Dataset dataset, boolean countCachedExtras, String m if (dataset.isHarvested()) { return 0L; } - - System.out.print("mode: " + mode); - System.out.print("dataset: " + dataset); - System.out.print("version: " + version); + List filesToTalley = new ArrayList(); if (version == null || (mode != null && mode.equals("storage"))){ filesToTalley = dataset.getFiles(); } else { List fmds = version.getFileMetadatas(); - System.out.print("FileMetadata: " + fmds.size()); for (FileMetadata fmd : fmds){ - filesToTalley.add(fmd.getDataFile()); - } - + filesToTalley.add(fmd.getDataFile()); + } } - - System.out.print("filesToTalley: " + filesToTalley.size()); + //CACHED EXTRAS FOR DOWNLOAD? diff --git a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetDatasetStorageSizeCommand.java b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetDatasetStorageSizeCommand.java index 65882648669..c167c513955 100644 --- a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetDatasetStorageSizeCommand.java +++ b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetDatasetStorageSizeCommand.java @@ -73,7 +73,7 @@ public Map> getRequiredPermissions() { // for data file check permission on owning dataset return Collections.singletonMap("", mode != null && mode.equals("storage") ? Collections.singleton(Permission.ViewUnpublishedDataset) - : Collections.emptySet()); + : version !=null && version.isDraft() ? Collections.singleton(Permission.ViewUnpublishedDataset) : Collections.emptySet()); } }