Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

57529: Merded DEV to HEAD-BUG-FIX (4.3)
      57218: MNT-9727 : Remove Ant from packaged libraries
      Excluded ant-1.7.1.jar from build path of Data Model project.
      Fixed the tests and source files to use java.util.zip.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61843 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-11 21:04:15 +00:00
parent b4e45ef15c
commit 18e8f40d81
6 changed files with 25 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
* Copyright (C) 2005-2013 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -19,17 +19,18 @@
package org.alfresco.repo.exporter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.SortedMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipOutputStream;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.view.AVMZipExporterService;
import org.apache.poi.util.IOUtils;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipOutputStream;
/**
* Exporter which allows the saving of part of an AVM
@@ -63,7 +64,7 @@ public class AVMZipExporterServiceImpl implements AVMZipExporterService
public void export(File output, int version, String path, boolean recurse)
throws IOException, ZipException
{
ZipOutputStream out = new ZipOutputStream(output);
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(output));
export(out, version, path, recurse);
out.close();
}

View File

@@ -18,6 +18,8 @@
*/
package org.alfresco.repo.importer;
import java.util.zip.ZipFile;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.security.authentication.AuthenticationContext;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
@@ -30,7 +32,6 @@ import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.PropertyCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tools.zip.ZipFile;
import org.springframework.context.ApplicationEvent;
import org.springframework.extensions.surf.util.AbstractLifecycleBean;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
* Copyright (C) 2005-2013 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -22,7 +22,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import org.alfresco.service.cmr.avm.AVMExistsException;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
@@ -31,8 +33,6 @@ import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
import org.alfresco.service.cmr.avm.AVMWrongTypeException;
import org.apache.poi.util.IOUtils;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipFile;
/**
* Importer which allows the loading of part of an AVM
@@ -106,7 +106,7 @@ public class AVMZipImporter implements AVMImporter
}
// Process the zip file
Enumeration<ZipEntry> entries = zip.getEntries();
Enumeration<ZipEntry> entries = (Enumeration<ZipEntry>) zip.entries();
while(entries.hasMoreElements())
{
// Grab the entry, and build the AVM path for it

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
* Copyright (C) 2005-2013 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -21,9 +21,9 @@ package org.alfresco.service.cmr.view;
import java.io.File;
import java.io.IOException;
import java.util.zip.ZipException;
import java.util.zip.ZipOutputStream;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.apache.tools.zip.ZipOutputStream;
/**
* Exporter which allows the saving of part of an AVM

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
* Copyright (C) 2005-2013 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -76,7 +76,6 @@ import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.GUID;
import org.alfresco.util.Pair;
import org.apache.tools.ant.taskdefs.Retry;
import org.springframework.context.ConfigurableApplicationContext;
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2010 Alfresco Software Limited.
* Copyright (C) 2009-2013 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -67,7 +67,6 @@ import org.alfresco.util.BaseAlfrescoSpringTest;
import org.alfresco.util.GUID;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tools.ant.filters.StringInputStream;
import org.mockito.ArgumentCaptor;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.support.DefaultTransactionDefinition;
@@ -418,7 +417,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
nodes.add(node);
String snapshot = createSnapshot(nodes);
receiver.saveSnapshot(transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
File stagingFolder = receiver.getStagingFolder(transferId);
snapshotFile = new File(stagingFolder, "snapshot.xml");
@@ -476,7 +475,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
nodes.add(tc.node);
String snapshot = createSnapshot(nodes);
receiver.saveSnapshot(tc.transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(tc.transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
receiver.saveContent(tc.transferId, tc.node.getUuid(), new ByteArrayInputStream(dummyContentBytes));
return null;
@@ -610,7 +609,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
tc.transferId = receiver.start("1234", true, receiver.getVersion());
String snapshot = createSnapshot(tc.nodes);
receiver.saveSnapshot(tc.transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(tc.transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
for (TransferManifestNode node : tc.nodes)
{
@@ -772,7 +771,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
tc.transferId = receiver.start("1234", true, receiver.getVersion());
String snapshot = createSnapshot(tc.nodes);
log.debug(snapshot);
receiver.saveSnapshot(tc.transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(tc.transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
for (TransferManifestNode node : tc.nodes)
{
@@ -876,7 +875,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
tc.deletedNode2,
tc.deletedNode11 }));
log.debug(snapshot);
receiver.saveSnapshot(tc.transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(tc.transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
return null;
}
@@ -972,7 +971,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
tc.transferId = receiver.start("1234", true, receiver.getVersion());
String snapshot = createSnapshot(Arrays.asList(new TransferManifestNode[] { tc.node2 }));
log.debug(snapshot);
receiver.saveSnapshot(tc.transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(tc.transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
receiver.saveContent(tc.transferId, tc.node2.getUuid(), new ByteArrayInputStream(dummyContentBytes));
return null;
@@ -1146,7 +1145,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
String snapshot = createSnapshot(nodes);
log.debug(snapshot);
receiver.saveSnapshot(tc.transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(tc.transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
for (TransferManifestNode node : nodes)
{
@@ -1189,7 +1188,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
tc.transferId = receiver.start("1234", true, receiver.getVersion());
String snapshot = createSnapshot(Arrays.asList(new TransferManifestNode[] { tc.deletedNode11 }));
log.debug(snapshot);
receiver.saveSnapshot(tc.transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(tc.transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
receiver.commit(tc.transferId);
return null;
@@ -1252,7 +1251,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
tc.transferId = receiver.start("1234", true, receiver.getVersion());
String snapshot = createSnapshot(Arrays.asList(new TransferManifestNode[] { tc.node2, tc.node11 }));
log.debug(snapshot);
receiver.saveSnapshot(tc.transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(tc.transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
receiver.saveContent(tc.transferId, tc.node2.getUuid(), new ByteArrayInputStream(dummyContentBytes));
receiver.commit(tc.transferId);
@@ -1335,7 +1334,7 @@ public class RepoTransferReceiverImplTest extends BaseAlfrescoSpringTest
String snapshot = createSnapshot(nodes);
startNewTransaction();
receiver.saveSnapshot(transferId, new StringInputStream(snapshot, "UTF-8"));
receiver.saveSnapshot(transferId, new ByteArrayInputStream(snapshot.getBytes("UTF-8")));
endTransaction();
for (TransferManifestNode node : nodes)