[2513300] Fix for bug [1774958] Nested folders do not export correctly

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3374 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Stuart Lewis
2009-01-18 21:35:22 +00:00
parent 0654064bd8
commit f9061c2d9f
2 changed files with 11 additions and 6 deletions

View File

@@ -486,7 +486,14 @@ public class ItemExport {
// written
while (!isDone) {
File fout = new File(destDir, myName);
if (myName.contains(File.separator))
{
String dirs = myName.substring(0, myName.lastIndexOf(File.separator));
File fdirs = new File(destDir + File.separator + dirs);
fdirs.mkdirs();
}
File fout = new File(destDir, myName);
if (fout.createNewFile()) {
FileOutputStream fos = new FileOutputStream(fout);
@@ -874,8 +881,6 @@ public class ItemExport {
*
* @param fileName
* name of the file to get the size
* @param eperson
* the eperson requesting file
* @return
* @throws Exception
*/
@@ -1051,9 +1056,8 @@ public class ItemExport {
* email for the from field
* @param ccMail -
* carbon copy email
* @param fileName -
* the file name to be downloaded. It is added to the url in the
* email
* @param error -
* the error message
* @throws MessagingException
*/
public static void emailErrorMessage(String toMail, String fromMail,