diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterManager.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterManager.java index c4289e39a6..2b7ac31341 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterManager.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterManager.java @@ -97,6 +97,8 @@ public class MediaFilterManager public static boolean isVerbose = false; // default to not verbose + public static boolean isQuiet = false; // default is noisy + public static boolean isForce = false; // default to not forced public static String identifier = null; // object scope limiter @@ -131,6 +133,8 @@ public class MediaFilterManager options.addOption("v", "verbose", false, "print all extracted text and other details to STDOUT"); + options.addOption("q", "quiet", false, + "do not print anything except in the event of errors."); options.addOption("f", "force", false, "force all bitstreams to be processed"); options.addOption("n", "noindex", false, @@ -190,6 +194,8 @@ public class MediaFilterManager isVerbose = true; } + isQuiet = line.hasOption('q'); + if (line.hasOption('n')) { updateIndex = false; @@ -382,6 +388,7 @@ public class MediaFilterManager // update search index? if (updateIndex) { + if (!isQuiet) System.out.println("Updating search index:"); DSIndexer.updateIndex(c); } @@ -657,6 +664,7 @@ public class MediaFilterManager // if exists and overwrite = false, exit if (!overWrite && (existingBitstream != null)) { + if (!isQuiet) System.out.println("SKIPPED: bitstream " + source.getID() + " (item: " + item.getHandle() + ") because '" + newName + "' already exists"); @@ -666,6 +674,7 @@ public class MediaFilterManager InputStream destStream = formatFilter.getDestinationStream(source.retrieve()); if (destStream == null) { + if (!isQuiet) System.out.println("SKIPPED: bitstream " + source.getID() + " (item: " + item.getHandle() + ") because filtering was unsuccessful"); @@ -709,6 +718,7 @@ public class MediaFilterManager targetBundle.removeBitstream(existingBitstream); } + if (!isQuiet) System.out.println("FILTERED: bitstream " + source.getID() + " (item: " + item.getHandle() + ") and created '" + newName + "'"); @@ -746,6 +756,7 @@ public class MediaFilterManager { if(skipList!=null && skipList.contains(identifier)) { + if (!isQuiet) System.out.println("SKIP-LIST: skipped bitstreams within identifier " + identifier); return true; } diff --git a/dspace/CHANGES b/dspace/CHANGES index ebfe0e261b..2d081fed7e 100644 --- a/dspace/CHANGES +++ b/dspace/CHANGES @@ -62,6 +62,7 @@ - [DS-333] Adjust SWORD ingest crosswalk to store bibliographic citation (Larry Stone) + - [DS-347] Add --quiet option to filter-media (MediaFilterManager) to disable progress messages - [DS-297] Move PostgreSQL-specific SQL into etc/postgres for greater clarity - [DS-338] Disable cache advice (Expires header) on Bitstream download that requires authorization (XMLUI) - [DS-285] Respond to If-Modified-Since request header in XMLUI, also provide Last-Modified response header for Bitstreams @@ -98,7 +99,7 @@ - [DS-271] Make the OAI DC crosswalk configurable - [DS-260] Template item some times has owningCollection filled and some times not - [DS-309] Shiboleth default roles are applied also to anonymous user and user logged-in with other methods - - [DS-270] Make delegate admin permissions configurable + - [DS-270] Make delegate admin permissions configurable (Tim Donohue) - [DS-218] Cannot add/remove email subscriptions from Profile page in XMLUI