(James Rutherford)

- SF Patch #1694943 for SF feature request #1691277 Importing: Workaround for ext3 subdirectory limitation


git-svn-id: http://scm.dspace.org/svn/repo/trunk@1758 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
James Rutherford
2007-04-05 14:01:44 +00:00
parent cd3468fba3
commit 2708a082d6
2 changed files with 35 additions and 5 deletions

View File

@@ -1,8 +1,5 @@
1.4.2 beta
===========
(Richard Jones)
- SF Patch #1659837 ItemIterator now deals with item ids also
(Andrea Bollini)
- SF Patch #1528142 Malformed OAI-PMH response: illegal bytes in UTF-8 for SF Bug #1490162
@@ -14,6 +11,7 @@
(Richard Jones)
- SF Patch #1659868 Improved database level debugging
- SF Patch #1659901 Import community and collection structure
- SF Patch #1659837 ItemIterator now deals with item ids also
(Mike Judd)
- SF Patch #1528142 Malformed OAI-PMH response: illegal bytes in UTF-8 for SF Bug #1490162
@@ -39,6 +37,9 @@
- SF Patch #1591969 for SF bug #1583372 DCDate.toString returns invalid string
- SF Patch #1621889 for SF Bug #1606789 When collection is deleted, mapped item remains in community
(James Rutherford)
- SF Patch #1694943 for SF feature request #1691277 Importing: Workaround for ext3 subdirectory limitation
(Dorothea Salo)
- SF Patch #1557948 Link subjects and authors on item pages

View File

@@ -44,6 +44,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
@@ -85,6 +86,8 @@ import org.dspace.handle.HandleManager;
*/
public class ItemExport
{
private static final int SUBDIR_LIMIT = 0;
/*
*
*/
@@ -260,13 +263,39 @@ public class ItemExport
String destDirName, int seqStart) throws Exception
{
int mySequenceNumber = seqStart;
int counter = SUBDIR_LIMIT - 1;
int subDirSuffix = 0;
String fullPath = destDirName;
String subdir = "";
File dir;
if (SUBDIR_LIMIT > 0)
{
dir = new File(destDirName);
if (!dir.isDirectory())
{
throw new IOException(destDirName + " is not a directory.");
}
}
System.out.println("Beginning export");
while (i.hasNext())
{
if (SUBDIR_LIMIT > 0 && ++counter == SUBDIR_LIMIT)
{
subdir = new Integer(subDirSuffix++).toString();
fullPath = destDirName + dir.separatorChar + subdir;
counter = 0;
if (!new File(fullPath).mkdirs())
{
throw new IOException("Error, can't make dir " + fullPath);
}
}
System.out.println("Exporting item to " + mySequenceNumber);
exportItem(c, i.next(), destDirName, mySequenceNumber);
exportItem(c, i.next(), fullPath, mySequenceNumber);
mySequenceNumber++;
}
}