Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DS-2921] Item registration ignores bundles #1193

Merged
merged 1 commit into from Nov 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -275,7 +275,7 @@ public void addItems(Context c, List<Collection> mycollections,
File outFile = null;
PrintWriter mapOut = null;
try {
Map<String, String> skipItems = new HashMap<String, String>(); // set of items to skip if in 'resume'
Map<String, String> skipItems = new HashMap<>(); // set of items to skip if in 'resume'
// mode

System.out.println("Adding items from directory: " + sourceDir);
Expand Down Expand Up @@ -595,7 +595,7 @@ protected void deleteItem(Context c, String myhandle) throws Exception
// read in the map file and generate a hashmap of (file,handle) pairs
protected Map<String, String> readMapFile(String filename) throws Exception
{
Map<String, String> myHash = new HashMap<String, String>();
Map<String, String> myHash = new HashMap<>();

BufferedReader is = null;
try
Expand Down Expand Up @@ -893,7 +893,7 @@ protected List<String> processContentsFile(Context c, Item i, String path,
{
File contentsFile = new File(path + File.separatorChar + filename);
String line = "";
List<String> options = new ArrayList<String>();
List<String> options = new ArrayList<>();

System.out.println("\tProcessing contents file: " + contentsFile);

Expand Down Expand Up @@ -1228,7 +1228,7 @@ protected void registerBitstream(Context c, Item i, int assetstore,
Bitstream bs = null;
String newBundleName = bundleName;

if (bundleName == null)
if (StringUtils.isBlank(bundleName))
{
// is it license.txt?
if (bitstreamPath.endsWith("license.txt"))
Expand Down Expand Up @@ -1260,7 +1260,7 @@ protected void registerBitstream(Context c, Item i, int assetstore,
}

// now add the bitstream
bs = bitstreamService.register(c, assetstore, bitstreamPath);
bs = bitstreamService.register(c, targetBundle, assetstore, bitstreamPath);

// set the name to just the filename
int iLastSlash = bitstreamPath.lastIndexOf('/');
Expand Down Expand Up @@ -1949,7 +1949,7 @@ public List<BatchUpload> getImportsAvailable(EPerson eperson)
return null;
}

Map<String, BatchUpload> fileNames = new TreeMap<String, BatchUpload>();
Map<String, BatchUpload> fileNames = new TreeMap<>();

for (String fileName : uploadDir.list())
{
Expand All @@ -1964,7 +1964,7 @@ public List<BatchUpload> getImportsAvailable(EPerson eperson)

if (fileNames.size() > 0)
{
return new ArrayList<BatchUpload>(fileNames.values());
return new ArrayList<>(fileNames.values());
}

return null;
Expand Down