Author: tolusha
Date: 2011-10-04 04:17:14 -0400 (Tue, 04 Oct 2011)
New Revision: 5014
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestDirectoryHelper.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DirectoryRestore.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/TestRdbmsFullBackupJob.java
Log:
EXOJCR-1565: compress directory into single file
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DirectoryRestore.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DirectoryRestore.java 2011-10-04
06:51:40 UTC (rev 5013)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DirectoryRestore.java 2011-10-04
08:17:14 UTC (rev 5014)
@@ -48,9 +48,9 @@
protected final List<File> dataDirs = new ArrayList<File>();
/**
- * The list of directories with backuped data.
+ * The list of compressed files.
*/
- protected final List<File> backupDirs = new ArrayList<File>();
+ protected final List<File> zipFiles = new ArrayList<File>();
/**
* The list of temporary directories.
@@ -71,24 +71,24 @@
* Constructor DirectoryRestorer.
*
* @param dataDirs
- * @param backupDirs
+ * @param zipFiles
*/
- public DirectoryRestore(List<File> dataDirs, List<File> backupDirs)
+ public DirectoryRestore(List<File> dataDirs, List<File> zipFiles)
{
this.dataDirs.addAll(dataDirs);
- this.backupDirs.addAll(backupDirs);
+ this.zipFiles.addAll(zipFiles);
}
/**
* Constructor DirectoryRestorer.
*
* @param dataDir
- * @param backupDir
+ * @param zipFile
*/
- public DirectoryRestore(File dataDir, File backupDir)
+ public DirectoryRestore(File dataDir, File zipFile)
{
this.dataDirs.add(dataDir);
- this.backupDirs.add(backupDir);
+ this.zipFiles.add(zipFile);
}
/**
@@ -96,8 +96,10 @@
*/
public void clean() throws BackupException
{
- for (File dataDir : dataDirs)
+ for (int i = 0; i < dataDirs.size(); i++)
{
+ File dataDir = dataDirs.get(i);
+
try
{
File tmpDir = new File(tempDir, PREFIX + IdGenerator.generate());
@@ -122,14 +124,14 @@
*/
public void restore() throws BackupException
{
- for (int i = 0; i < backupDirs.size(); i++)
+ for (int i = 0; i < zipFiles.size(); i++)
{
- File backupDir = backupDirs.get(i);
+ File zipFile = zipFiles.get(i);
File dataDir = dataDirs.get(i);
try
{
- DirectoryHelper.uncompressDirectory(backupDir, dataDir);
+ DirectoryHelper.uncompressDirectory(zipFile, dataDir);
}
catch (IOException e)
{
@@ -189,7 +191,7 @@
}
dataDirs.clear();
- backupDirs.clear();
+ zipFiles.clear();
tmpDirs.clear();
}
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-10-04
06:51:40 UTC (rev 5013)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-10-04
08:17:14 UTC (rev 5014)
@@ -18,9 +18,9 @@
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
+import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.WildcardQuery;
-import org.apache.lucene.search.BooleanClause.Occur;
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.configuration.ConfigurationManager;
@@ -1571,8 +1571,8 @@
}
else
{
- File destDir = new File(storageDir, getStorageName());
- DirectoryHelper.compressDirectory(indexDir, destDir);
+ File destZip = new File(storageDir, getStorageName() + ".zip");
+ DirectoryHelper.compressDirectory(indexDir, destZip);
}
}
catch (RepositoryConfigurationException e)
@@ -1613,16 +1613,16 @@
{
try
{
- File backupDir = new
File((File)context.getObject(DataRestoreContext.STORAGE_DIR), getStorageName());
+ File zipFile = new File((File)context.getObject(DataRestoreContext.STORAGE_DIR),
getStorageName() + ".zip");
- if (!PrivilegedFileHelper.exists(backupDir))
+ if (!PrivilegedFileHelper.exists(zipFile))
{
- throw new RepositoryConfigurationException("Can't restore index.
Directory " + backupDir.getName()
+ throw new RepositoryConfigurationException("Can't restore index.
File " + zipFile.getName()
+ " doesn't exists");
}
else
{
- return new DirectoryRestore(getIndexDirectory(), backupDir);
+ return new DirectoryRestore(getIndexDirectory(), zipFile);
}
}
catch (RepositoryConfigurationException e)
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-10-04
06:51:40 UTC (rev 5013)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-10-04
08:17:14 UTC (rev 5014)
@@ -73,6 +73,7 @@
import java.io.File;
import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.security.PrivilegedExceptionAction;
import java.sql.Connection;
@@ -1119,10 +1120,8 @@
}
else
{
- File destValuesDir = new File(storageDir, "values");
- File destDir = new File(destValuesDir, valueStorage.getId());
-
- DirectoryHelper.compressDirectory(srcDir, destDir);
+ File zipFile = new File(storageDir, "values-" +
valueStorage.getId() + ".zip");
+ DirectoryHelper.compressDirectory(srcDir, zipFile);
}
}
}
@@ -1308,16 +1307,22 @@
restorers.add(new DBRestore(storageDir, jdbcConn, tables, wsConfig,
swapCleaner));
}
+
// prepare value storage restorer
- File backupValueStorageDir = new File(storageDir, "values");
+ List<ValueStorageEntry> valueStorages =
wsConfig.getContainer().getValueStorages();
+ String[] valueStoragesFiles = PrivilegedFileHelper.list(storageDir, new
FilenameFilter()
+ {
+ public boolean accept(File dir, String name)
+ {
+ return name.startsWith("values-") &&
name.endsWith(".zip");
+ }
+ });
+
if (wsConfig.getContainer().getValueStorages() != null)
{
List<File> dataDirs = new ArrayList<File>();
List<File> backupDirs = new ArrayList<File>();
- List<ValueStorageEntry> valueStorages =
wsConfig.getContainer().getValueStorages();
- String[] valueStoragesFiles =
PrivilegedFileHelper.list(backupValueStorageDir);
-
if ((valueStoragesFiles == null && valueStorages.size() != 0)
|| (valueStoragesFiles != null && valueStoragesFiles.length !=
valueStorages.size()))
{
@@ -1327,18 +1332,18 @@
for (ValueStorageEntry valueStorage : valueStorages)
{
- File backupDir = new File(backupValueStorageDir, valueStorage.getId());
- if (!PrivilegedFileHelper.exists(backupDir))
+ File zipFile = new File(storageDir, "values-" +
valueStorage.getId() + ".zip");
+ if (!PrivilegedFileHelper.exists(zipFile))
{
- throw new RepositoryConfigurationException("Can't restore
value storage. Directory "
- + backupDir.getName() + " doesn't exists");
+ throw new RepositoryConfigurationException("Can't restore
value storage. File " + zipFile.getName()
+ + " doesn't exists");
}
else
{
File dataDir = new
File(valueStorage.getParameterValue(FileValueStorage.PATH));
dataDirs.add(dataDir);
- backupDirs.add(backupDir);
+ backupDirs.add(zipFile);
}
}
@@ -1346,7 +1351,7 @@
}
else
{
- if (PrivilegedFileHelper.exists(backupValueStorageDir))
+ if (valueStoragesFiles != null && valueStoragesFiles.length != 0)
{
throw new RepositoryConfigurationException("Value storage didn't
configure in workspace ["
+ wsConfig.getName() + "] configuration but value storage backup
files exist");
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java 2011-10-04
06:51:40 UTC (rev 5013)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java 2011-10-04
08:17:14 UTC (rev 5014)
@@ -108,15 +108,7 @@
in = PrivilegedFileHelper.fileInputStream(srcPath);
out = PrivilegedFileHelper.fileOutputStream(dstPath);
- // Transfer bytes from in to out
- byte[] buf = new byte[2048];
-
- int len;
-
- while ((len = in.read(buf)) > 0)
- {
- out.write(buf, 0, len);
- }
+ transfer(in, out);
}
finally
{
@@ -166,50 +158,72 @@
}
/**
- * Compress directory.
+ * Compress data. In case when <code>rootPath</code> is a directory this
method
+ * compress all files and folders inside the directory into single one. IOException
+ * will be thrown if directory is empty. If the <code>rootPath</code> is
the file
+ * the only this file will be compressed.
*
- * @param srcPath
- * source path
- * @param dstPath
- * destination path
+ * @param rootPath
+ * the root path, can be the directory or the file
+ * @param dstZipPath
+ * the path to the destination compressed file
* @throws IOException
* if any exception occurred
*/
- public static void compressDirectory(File srcPath, File dstPath) throws IOException
+ public static void compressDirectory(File rootPath, File dstZipPath) throws
IOException
{
- if (PrivilegedFileHelper.isDirectory(srcPath))
+ ZipOutputStream zip = PrivilegedFileHelper.zipOutputStream(dstZipPath);
+ try
{
- if (!PrivilegedFileHelper.exists(dstPath))
+ if (PrivilegedFileHelper.isDirectory(rootPath))
{
- PrivilegedFileHelper.mkdirs(dstPath);
+ String files[] = PrivilegedFileHelper.list(rootPath);
+ for (int i = 0; i < files.length; i++)
+ {
+ compressDirectory("", new File(rootPath, files[i]), zip);
+ }
}
+ else
+ {
+ compressDirectory("", rootPath, zip);
+ }
+ }
+ finally
+ {
+ if (zip != null)
+ {
+ zip.flush();
+ zip.close();
+ }
+ }
+ }
+ /**
+ * Compress files and directories.
+ */
+ private static void compressDirectory(String relativePath, File srcPath,
ZipOutputStream zip) throws IOException
+ {
+ if (PrivilegedFileHelper.isDirectory(srcPath))
+ {
+ zip.putNextEntry(new ZipEntry(relativePath + "/" + srcPath.getName() +
"/"));
+ zip.closeEntry();
+
String files[] = PrivilegedFileHelper.list(srcPath);
for (int i = 0; i < files.length; i++)
{
- compressDirectory(new File(srcPath, files[i]), new File(dstPath, files[i]));
+ compressDirectory(relativePath + "/" + srcPath.getName(), new
File(srcPath, files[i]), zip);
}
}
else
{
- InputStream in = null;
- ZipOutputStream out = null;
-
+ InputStream in = PrivilegedFileHelper.fileInputStream(srcPath);
try
{
- in = PrivilegedFileHelper.fileInputStream(srcPath);
- out = PrivilegedFileHelper.zipOutputStream(dstPath);
- out.putNextEntry(new ZipEntry(srcPath.getName()));
+ zip.putNextEntry(new ZipEntry(relativePath + "/" +
srcPath.getName()));
- // Transfer bytes from in to out
- byte[] buf = new byte[2048];
+ transfer(in, zip);
- int len;
-
- while ((len = in.read(buf)) > 0)
- {
- out.write(buf, 0, len);
- }
+ zip.closeEntry();
}
finally
{
@@ -217,29 +231,74 @@
{
in.close();
}
-
- if (out != null)
- {
- out.flush();
- out.closeEntry();
- out.close();
- }
}
}
}
/**
- * Uncompress directory.
+ * Uncompress data to the destination directory. If
<code>srcZipPath</code> is the directory we assume
+ * that every file in the directory is compressed, in other case
<code>srcZipPath</code> should contain
+ * the compress data.
*
- * @param srcPath
- * source path
- * @param dstPath
+ * @param srcZipPath
+ * path to the compressed file, could be the file or the directory
+ * @param dstDirPath
* destination path
* @throws IOException
* if any exception occurred
*/
- public static void uncompressDirectory(File srcPath, File dstPath) throws IOException
+ public static void uncompressDirectory(File srcZipPath, File dstDirPath) throws
IOException
{
+ if (PrivilegedFileHelper.isDirectory(srcZipPath))
+ {
+ uncompressEveryFileInDirectory(srcZipPath, dstDirPath);
+ }
+ else
+ {
+
+ ZipInputStream in = PrivilegedFileHelper.zipInputStream(srcZipPath);
+ ZipEntry entry = null;
+
+ try
+ {
+ while ((entry = in.getNextEntry()) != null)
+ {
+ File dstFile = new File(dstDirPath, entry.getName());
+ PrivilegedFileHelper.mkdirs(dstFile.getParentFile());
+
+ if (entry.isDirectory())
+ {
+ PrivilegedFileHelper.mkdirs(dstFile);
+ }
+ else
+ {
+ OutputStream out = PrivilegedFileHelper.fileOutputStream(dstFile);
+ try
+ {
+ transfer(in, out);
+ }
+ finally
+ {
+ out.close();
+ }
+ }
+ }
+ }
+ finally
+ {
+ if (in != null)
+ {
+ in.close();
+ }
+ }
+ }
+ }
+
+ /**
+ * Uncompress data in case when every file in the directory is compressed.
+ */
+ private static void uncompressEveryFileInDirectory(File srcPath, File dstPath) throws
IOException
+ {
if (PrivilegedFileHelper.isDirectory(srcPath))
{
if (!PrivilegedFileHelper.exists(dstPath))
@@ -250,7 +309,7 @@
String files[] = PrivilegedFileHelper.list(srcPath);
for (int i = 0; i < files.length; i++)
{
- uncompressDirectory(new File(srcPath, files[i]), new File(dstPath,
files[i]));
+ uncompressEveryFileInDirectory(new File(srcPath, files[i]), new File(dstPath,
files[i]));
}
}
else
@@ -262,17 +321,10 @@
{
in = PrivilegedFileHelper.zipInputStream(srcPath);
in.getNextEntry();
+
out = PrivilegedFileHelper.fileOutputStream(dstPath);
- // Transfer bytes from in to out
- byte[] buf = new byte[2048];
-
- int len;
-
- while ((len = in.read(buf)) > 0)
- {
- out.write(buf, 0, len);
- }
+ transfer(in, out);
}
finally
{
@@ -290,6 +342,21 @@
}
/**
+ * Transfer bytes from in to out
+ */
+ public static void transfer(InputStream in, OutputStream out) throws IOException
+ {
+ byte[] buf = new byte[2048];
+
+ int len;
+
+ while ((len = in.read(buf)) > 0)
+ {
+ out.write(buf, 0, len);
+ }
+ }
+
+ /**
* Rename file.
*
* @param srcFile
@@ -314,9 +381,8 @@
// rename fails, we manually rename by copying the srcFile file to the new one
if (!PrivilegedFileHelper.renameTo(srcFile, dstFile))
{
- java.io.InputStream in = null;
- java.io.OutputStream out = null;
- byte buffer[] = null;
+ InputStream in = null;
+ OutputStream out = null;
try
{
in = PrivilegedFileHelper.fileInputStream(srcFile);
@@ -324,15 +390,7 @@
// see if the buffer needs to be initialized. Initialization is
// only done on-demand since many VM's will never run into the renameTo
// bug and hence shouldn't waste 1K of mem for no reason.
- if (buffer == null)
- {
- buffer = new byte[1024];
- }
- int len;
- while ((len = in.read(buffer)) >= 0)
- {
- out.write(buffer, 0, len);
- }
+ transfer(in, out);
// delete the srcFile file.
PrivilegedFileHelper.delete(srcFile);
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestDirectoryHelper.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestDirectoryHelper.java
(rev 0)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/io/TestDirectoryHelper.java 2011-10-04
08:17:14 UTC (rev 5014)
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.utils.io;
+
+import junit.framework.TestCase;
+
+import org.exoplatform.services.jcr.impl.util.io.DirectoryHelper;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * @author <a href="abazko(a)exoplatform.com">Anatoliy Bazko</a>
+ * @version $Id: TestDirectoryHelper.java 34360 2009-07-22 23:58:59Z tolusha $
+ */
+public class TestDirectoryHelper extends TestCase
+{
+
+ public void testCompressEmptyDirectory() throws Exception
+ {
+ File rootDir = new File("./target/emptyDir");
+ rootDir.mkdir();
+
+ File zipFile = new File("./target/compress.zip");
+
+ try
+ {
+ DirectoryHelper.compressDirectory(rootDir, zipFile);
+ fail("Exception should be thrown");
+ }
+ catch (IOException e)
+ {
+ // can't compress empty directory
+ }
+ }
+
+ public void testCompressDirectory() throws Exception
+ {
+ // compress/compress.1
+ File rootDir = new File("./target/compress");
+ rootDir.mkdir();
+
+ OutputStream out = new FileOutputStream(new File(rootDir,
"compress.1"));
+ out.write("compress.1".getBytes());
+ out.close();
+
+ // compress/a/a.1
+ // compress/a/a.2
+ File dirA = new File(rootDir, "a");
+ dirA.mkdir();
+
+ out = new FileOutputStream(new File(dirA, "a.1"));
+ out.write("a.1".getBytes());
+ out.close();
+
+ out = new FileOutputStream(new File(dirA, "a.2"));
+ out.write("a.2".getBytes());
+ out.close();
+
+ // compress/a/c/c.1
+ File dirAC = new File(dirA, "c");
+ dirAC.mkdir();
+
+ out = new FileOutputStream(new File(dirAC, "c.1"));
+ out.write("c.1".getBytes());
+ out.close();
+
+ // compress/b/b.1
+ File dirB = new File(rootDir, "b");
+ dirB.mkdir();
+
+ out = new FileOutputStream(new File(dirB, "b.1"));
+ out.write("b.1".getBytes());
+ out.close();
+
+ File zipFile = new File("./target/compressDir.zip");
+
+ DirectoryHelper.compressDirectory(rootDir, zipFile);
+
+ assertTrue(zipFile.exists());
+
+ File dir = new File("./target/uncompress");
+ DirectoryHelper.uncompressDirectory(zipFile, dir);
+
+ assertFile(dir, "compress.1");
+ assertFile(new File(dir, "a"), "a.1");
+ assertFile(new File(dir, "a"), "a.2");
+ assertFile(new File(dir, "b"), "b.1");
+ assertFile(new File(new File(dir, "a"), "c"),
"c.1");
+ }
+
+ public void testCompressFile() throws Exception
+ {
+ OutputStream out = new FileOutputStream(new
File("./target/compress.file"));
+ out.write("compress.file".getBytes());
+ out.close();
+
+ File zipFile = new File("./target/compressFile.zip");
+
+ DirectoryHelper.compressDirectory(new File("./target/compress.file"),
zipFile);
+
+ assertTrue(zipFile.exists());
+
+ File dir = new File("./target/uncompress");
+ DirectoryHelper.uncompressDirectory(zipFile, dir);
+
+ assertFile(dir, "compress.file");
+ }
+
+ private void assertFile(File dir, String fileName) throws Exception
+ {
+ byte[] buf = new byte[20];
+
+ File file = new File(dir, fileName);
+ assertTrue(file.exists());
+
+ InputStream in = new FileInputStream(file);
+ int len = in.read(buf);
+ in.close();
+ assertEquals(fileName, new String(buf, 0, len));
+ }
+}
Modified:
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/TestRdbmsFullBackupJob.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/TestRdbmsFullBackupJob.java 2011-10-04
06:51:40 UTC (rev 5013)
+++
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/TestRdbmsFullBackupJob.java 2011-10-04
08:17:14 UTC (rev 5014)
@@ -19,7 +19,6 @@
package org.exoplatform.services.jcr.ext.backup;
import org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob;
-import org.exoplatform.services.jcr.impl.core.query.SystemSearchManager;
import java.io.File;
import java.net.URL;
@@ -49,28 +48,15 @@
URL url = job.getStorageURL();
assertNotNull(url);
- File valuesDir = new File(url.getFile(), "values");
- assertTrue(valuesDir.exists());
- String values[] = valuesDir.list();
-
- assertEquals(values.length, 1);
- assertTrue(new File(valuesDir, values[0]).isDirectory());
-
- File indexesDir = new File(url.getFile(), "index");
- assertTrue(indexesDir.exists());
-
- indexesDir = new File(url.getFile(), "index" + "_" +
SystemSearchManager.INDEX_DIR_SUFFIX);
- assertTrue(indexesDir.exists());
-
+ assertTrue(new File(url.getFile(), "values-draft.zip").exists());
+ assertTrue(new File(url.getFile(), "index.zip").exists());
+ assertTrue(new File(url.getFile(), "index_system.zip").exists());
assertTrue(new File(url.getFile(), "JCR_MITEM.dump").exists());
assertTrue(new File(url.getFile(), "JCR_MITEM.len").exists());
-
assertTrue(new File(url.getFile(), "JCR_MVALUE.dump").exists());
assertTrue(new File(url.getFile(), "JCR_MVALUE.len").exists());
-
assertTrue(new File(url.getFile(), "JCR_MREF.dump").exists());
assertTrue(new File(url.getFile(), "JCR_MREF.len").exists());
-
}
public void testRDBMSFullBackupJob() throws Exception
@@ -89,15 +75,10 @@
URL url = job.getStorageURL();
assertNotNull(url);
- File valuesDir = new File(url.getFile(), "values");
- assertFalse(valuesDir.exists());
+ assertFalse(new File(url.getFile(), "values-draft.zip").exists());
+ assertTrue(new File(url.getFile(), "index.zip").exists());
+ assertFalse(new File(url.getFile(), "index_system.zip").exists());
- File indexesDir = new File(url.getFile(), "index");
- assertTrue(indexesDir.exists());
-
- indexesDir = new File(url.getFile(), "index" + "_" +
SystemSearchManager.INDEX_DIR_SUFFIX);
- assertFalse(indexesDir.exists());
-
assertTrue(new File(url.getFile(), "JCR_MITEM.dump").exists());
assertTrue(new File(url.getFile(), "JCR_MITEM.len").exists());