Author: tolusha
Date: 2010-06-14 05:24:14 -0400 (Mon, 14 Jun 2010)
New Revision: 2567
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SysViewWorkspaceInitializer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/FilePathHolder.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataReader.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/storage/value/fs/CASableIOSupport.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/SimpleFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/CASableWriteValue.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/PrivilegedFileHelper.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/TextExtractorTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/directory/DirectoryManagerTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRestoreWorkspaceInitializer.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestArabicSearch.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestDateSearch.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestErrorMultithreading.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestExcelFileSearch.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/security/TestSecurityRepositoryManagment.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileValueIO.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/TestValueFileIOHelper.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestPersistedValueData.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueData.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueDataSpooling.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestValueImpl.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/java/TestFileLock.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/TestLoadRepo.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/dataflow/persistent/TestGetNodesConcurrentModification.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf/TestBulkItemsAdd.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/storage/fs/TestFSReadWrite.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/usecases/export/ExportWorkspaceSystemViewTest.java
Log:
EXOJCR-756: revert file creation via PrivilegedFileHelper
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -170,9 +170,9 @@
else
{
URL filePath = configurationService.getURL(param.getValue());
- File sourceConfig = PrivilegedFileHelper.file(filePath.toURI());
+ File sourceConfig = new File(filePath.toURI());
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmm");
- File backUp = PrivilegedFileHelper.file(sourceConfig.getAbsoluteFile() +
"_" + format.format(new Date()));
+ File backUp = new File(sourceConfig.getAbsoluteFile() + "_" +
format.format(new Date()));
if (!sourceConfig.renameTo(backUp))
throw new RepositoryException("Can't back up configuration on
path " + sourceConfig.getAbsolutePath());
saveStream = PrivilegedFileHelper.fileOutputStream(sourceConfig);
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -47,7 +47,6 @@
import java.io.Externalizable;
import java.io.File;
import java.io.FileFilter;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -100,7 +99,7 @@
else
restorePath = fullBackupPath;
- this.tempDir =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"));
+ this.tempDir = new File(System.getProperty("java.io.tmpdir"));
}
@Override
@@ -286,7 +285,7 @@
{
ArrayList<File> list = new ArrayList<File>();
- File rDir = PrivilegedFileHelper.file(restoreDir);
+ File rDir = new File(restoreDir);
Pattern fullBackupPattern = Pattern.compile(".+\\.0");
for (File f : rDir.listFiles(new BackupFilesFilter()))
@@ -308,7 +307,7 @@
private String getFullBackupPath()
{
- File rDir = PrivilegedFileHelper.file(restoreDir);
+ File rDir = new File(restoreDir);
Pattern p = Pattern.compile(".+\\.0");
for (File f : rDir.listFiles(new BackupFilesFilter()))
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SysViewWorkspaceInitializer.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SysViewWorkspaceInitializer.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SysViewWorkspaceInitializer.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -51,7 +51,6 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -417,7 +416,7 @@
+ ") RestoreIntializer should have mandatory parameter "
+ SysViewWorkspaceInitializer.RESTORE_PATH_PARAMETER);
- this.tempDir =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"));
+ this.tempDir = new File(System.getProperty("java.io.tmpdir"));
}
/**
@@ -463,7 +462,7 @@
WorkspaceDataContainer.DEF_MAXBUFFERSIZE);
this.restorePath = restorePath;
- this.tempDir =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"));
+ this.tempDir = new File(System.getProperty("java.io.tmpdir"));
}
/**
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -34,7 +34,6 @@
import org.exoplatform.services.jcr.impl.core.query.SearchManager;
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
import
org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import org.exoplatform.services.jcr.observation.ExtendedEvent;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -118,7 +117,7 @@
public void add(LockData lock) throws LockException
{
log.debug("add event fire");
- File lockFile = PrivilegedFileHelper.file(rootDir, lock.getNodeIdentifier());
+ File lockFile = new File(rootDir, lock.getNodeIdentifier());
if (lockFile.exists())
{
@@ -144,7 +143,7 @@
public void remove(LockData lock) throws LockException
{
log.debug("remove event fire");
- File lockFile = PrivilegedFileHelper.file(rootDir, lock.getNodeIdentifier());
+ File lockFile = new File(rootDir, lock.getNodeIdentifier());
if (!lockFile.exists())
{
// throw new LockException("Persistent lock information not exists");
@@ -214,7 +213,7 @@
// remove files
for (int i = 0; i < list.length; i++)
{
- File lockFile = PrivilegedFileHelper.file(rootDir, list[i]);
+ File lockFile = new File(rootDir, list[i]);
if (!lockFile.exists())
{
log.warn("Persistent lock information for node id " + list[i] +
" doesn't exists");
@@ -288,7 +287,7 @@
if (root == null)
throw new RepositoryConfigurationException("Repository service
configuration." + " Source name ("
+ PARAM_ROOT_DIR + ") is expected");
- rootDir = PrivilegedFileHelper.file(root);
+ rootDir = new File(root);
if (rootDir.exists())
{
if (!rootDir.isDirectory())
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -67,7 +67,6 @@
import java.io.BufferedInputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@@ -488,7 +487,7 @@
if (path != null)
{
- indexDirectory = PrivilegedFileHelper.file(path);
+ indexDirectory = new File(path);
if (!indexDirectory.exists())
{
if (!indexDirectory.mkdirs())
@@ -522,7 +521,7 @@
else
{
// read local namespace mappings
- File mapFile = PrivilegedFileHelper.file(indexDirectory, NS_MAPPING_FILE);
+ File mapFile = new File(indexDirectory, NS_MAPPING_FILE);
if (mapFile.exists())
{
// be backward compatible and use ns_mappings.properties from
@@ -591,7 +590,7 @@
new Integer(getIndexFormatVersion().getVersion()));
}
- File file = PrivilegedFileHelper.file(indexDirectory, ERROR_LOG);
+ File file = new File(indexDirectory, ERROR_LOG);
errorLog = new ErrorLog(file, errorLogfileSize);
// reprocess any notfinished notifies;
if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
@@ -1321,14 +1320,14 @@
int lastSeparator = synonymProviderConfigPath.lastIndexOf(separator);
if (lastSeparator != -1)
{
- File root = PrivilegedFileHelper.file(path,
synonymProviderConfigPath.substring(0, lastSeparator));
+ File root = new File(path, synonymProviderConfigPath.substring(0,
lastSeparator));
fsr =
- new
BufferedInputStream(PrivilegedFileHelper.fileInputStream(PrivilegedFileHelper.file(root,
synonymProviderConfigPath
+ new BufferedInputStream(PrivilegedFileHelper.fileInputStream(new
File(root, synonymProviderConfigPath
.substring(lastSeparator + 1))));
}
else
{
- fsr = new
BufferedInputStream(PrivilegedFileHelper.fileInputStream(PrivilegedFileHelper.file(synonymProviderConfigPath)));
+ fsr = new BufferedInputStream(PrivilegedFileHelper.fileInputStream(new
File(synonymProviderConfigPath)));
}
synonymProviderConfigFs = fsr;
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -30,7 +30,6 @@
import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
import org.exoplatform.services.jcr.impl.util.JCRDateFormat;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHolder;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
import org.exoplatform.services.log.ExoLogger;
@@ -84,7 +83,7 @@
{
public Object run()
{
- tempDirectory =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"));
+ tempDirectory = new File(System.getProperty("java.io.tmpdir"));
return null;
}
};
@@ -105,7 +104,7 @@
{
public Object run()
{
- tempDirectory =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"));
+ tempDirectory = new File(System.getProperty("java.io.tmpdir"));
return null;
}
};
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -25,7 +25,6 @@
import java.io.Externalizable;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -236,7 +235,7 @@
byte[] buf = new byte[size];
in.readFully(buf);
- File f = PrivilegedFileHelper.file(new String(buf, "UTF-8"));
+ File f = new File(new String(buf, "UTF-8"));
// validate if exists
if (f.exists())
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/FilePathHolder.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/FilePathHolder.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/FilePathHolder.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -19,7 +19,6 @@
package org.exoplatform.services.jcr.impl.dataflow.serialization;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import java.io.File;
import java.util.ArrayList;
@@ -86,7 +85,7 @@
List<String> ls = new ArrayList<String>(filePathMap.values());
for (String fPath : ls)
- cleaner.addFile(PrivilegedFileHelper.file(fPath));
+ cleaner.addFile(new File(fPath));
}
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataReader.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataReader.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataReader.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -87,7 +87,7 @@
*/
public AbstractPersistedValueData read(ObjectReader in) throws
UnknownClassIdException, IOException
{
- File tempDirectory = PrivilegedFileHelper.file(SerializationConstants.TEMP_DIR);
+ File tempDirectory = new File(SerializationConstants.TEMP_DIR);
tempDirectory.mkdirs();
// read id
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 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -34,7 +34,6 @@
import
org.exoplatform.services.jcr.impl.storage.jdbc.statistics.StatisticsJDBCStorageConnection;
import org.exoplatform.services.jcr.impl.storage.jdbc.update.StorageUpdateManager;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerException;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
@@ -382,11 +381,11 @@
try
{
String sdParam = wsConfig.getContainer().getParameterValue(SWAPDIR_PROP);
- this.swapDirectory = PrivilegedFileHelper.file(sdParam);
+ this.swapDirectory = new File(sdParam);
}
catch (RepositoryConfigurationException e1)
{
- this.swapDirectory = PrivilegedFileHelper.file(DEF_SWAPDIR);
+ this.swapDirectory = new File(DEF_SWAPDIR);
}
if (!swapDirectory.exists())
swapDirectory.mkdirs();
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableIOSupport.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableIOSupport.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableIOSupport.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.jcr.impl.storage.value.fs;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -89,6 +88,6 @@
public File getFile(String hash)
{
// work with digest
- return PrivilegedFileHelper.file(channel.rootDir, channel.makeFilePath(hash, 0));
+ return new File(channel.rootDir, channel.makeFilePath(hash, 0));
}
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -25,7 +25,6 @@
import org.exoplatform.services.jcr.impl.storage.value.fs.operations.ValueFileIOHelper;
import org.exoplatform.services.jcr.impl.storage.value.fs.operations.WriteValue;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import org.exoplatform.services.jcr.storage.value.ValueIOChannel;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -96,7 +95,7 @@
this.storageId = storageId;
this.resources = resources;
- this.tempDir = PrivilegedFileHelper.file(rootDir, FileValueStorage.TEMP_DIR_NAME);
+ this.tempDir = new File(rootDir, FileValueStorage.TEMP_DIR_NAME);
}
/**
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -21,7 +21,6 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHolder;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.jcr.storage.value.ValueStoragePlugin;
import org.exoplatform.services.log.ExoLogger;
@@ -106,7 +105,7 @@
*/
protected void prepareRootDir(String rootDirPath) throws IOException,
RepositoryConfigurationException
{
- this.rootDir = PrivilegedFileHelper.file(rootDirPath);
+ this.rootDir = new File(rootDirPath);
if (!rootDir.exists())
{
@@ -115,7 +114,7 @@
log.info("Directory created: " + rootDir.getAbsolutePath());
// create internal temp dir
- File tempDir = PrivilegedFileHelper.file(rootDir, TEMP_DIR_NAME);
+ File tempDir = new File(rootDir, TEMP_DIR_NAME);
tempDir.mkdirs();
if (tempDir.exists() && tempDir.isDirectory())
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/SimpleFileIOChannel.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/SimpleFileIOChannel.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/SimpleFileIOChannel.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -20,7 +20,6 @@
import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHolder;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import java.io.File;
import java.io.FileFilter;
@@ -66,7 +65,7 @@
@Override
protected File getFile(String propertyId, int orderNumber) throws IOException
{
- return PrivilegedFileHelper.file(rootDir, makeFilePath(propertyId, orderNumber));
+ return new File(rootDir, makeFilePath(propertyId, orderNumber));
}
@Override
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -19,7 +19,6 @@
package org.exoplatform.services.jcr.impl.storage.value.fs;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -63,7 +62,7 @@
{
boolean res = deleteFromSuper();
if (res)
- deleteParent(PrivilegedFileHelper.file(getParent()));
+ deleteParent(new File(getParent()));
return res;
}
@@ -84,7 +83,7 @@
{
if (res = fp.delete())
{
- res = deleteParent(PrivilegedFileHelper.file(fp.getParent()));
+ res = deleteParent(new File(fp.getParent()));
}
else
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFileIOChannel.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFileIOChannel.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFileIOChannel.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -66,7 +66,7 @@
@Override
protected File[] getFiles(final String propertyId) throws IOException
{
- final File dir =
PrivilegedFileHelper.file(PrivilegedFileHelper.getAbsolutePath(rootDir) +
buildPath(propertyId));
+ final File dir = new File(PrivilegedFileHelper.getAbsolutePath(rootDir) +
buildPath(propertyId));
String[] fileNames = PrivilegedFileHelper.list(dir);
File[] files = new File[fileNames.length];
for (int i = 0; i < fileNames.length; i++)
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/CASableWriteValue.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/CASableWriteValue.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/CASableWriteValue.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -120,7 +120,7 @@
// write calc digest hash
// we need hash at first to know do we have to store file or just use one
// existing (with same hash)
- File temp = PrivilegedFileHelper.file(tempDir, IdGenerator.generate() +
"-" + propertyId + orderNumb + TEMP_FILE_EXTENSION);
+ File temp = new File(tempDir, IdGenerator.generate() + "-" + propertyId +
orderNumb + TEMP_FILE_EXTENSION);
FileDigestOutputStream out = cas.openFile(temp);
try
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -130,7 +130,7 @@
public Object run() throws Exception
{
// lock file in temp directory
- lockFile = PrivilegedFileHelper.file(tempDir, targetFile.getName() +
LOCK_FILE_EXTENSION);
+ lockFile = new File(tempDir, targetFile.getName() + LOCK_FILE_EXTENSION);
FileOutputStream lout = PrivilegedFileHelper.fileOutputStream(lockFile,
true);
lout.write(operationInfo.getBytes()); // TODO write info
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/PrivilegedFileHelper.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/PrivilegedFileHelper.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/PrivilegedFileHelper.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -23,7 +23,6 @@
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.net.URI;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
@@ -351,54 +350,6 @@
return AccessController.doPrivileged(action);
}
- public static File file(final String pathname)
- {
- PrivilegedAction<File> action = new PrivilegedAction<File>()
- {
- public File run()
- {
- return new File(pathname);
- }
- };
- return AccessController.doPrivileged(action);
- }
-
- public static File file(final URI uri)
- {
- PrivilegedAction<File> action = new PrivilegedAction<File>()
- {
- public File run()
- {
- return new File(uri);
- }
- };
- return AccessController.doPrivileged(action);
- }
-
- public static File file(final String parent, final String child)
- {
- PrivilegedAction<File> action = new PrivilegedAction<File>()
- {
- public File run()
- {
- return new File(parent, child);
- }
- };
- return AccessController.doPrivileged(action);
- }
-
- public static File file(final File parent, final String child)
- {
- PrivilegedAction<File> action = new PrivilegedAction<File>()
- {
- public File run()
- {
- return new File(parent, child);
- }
- };
- return AccessController.doPrivileged(action);
- }
-
public static String[] list(final File file)
{
PrivilegedAction<String[]> action = new PrivilegedAction<String[]>()
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -148,8 +148,8 @@
try
{
file =
- PrivilegedFileHelper.file(System.getProperty("user.dir"),
"Statistics" + category + "-"
- + System.currentTimeMillis() + ".csv");
+ new File(System.getProperty("user.dir"), "Statistics" +
category + "-" + System.currentTimeMillis()
+ + ".csv");
file.createNewFile();
pw = new PrintWriter(file);
}
@@ -159,7 +159,8 @@
+ " in the user directory, we will try to create it in the temp
directory", e);
try
{
- file = PrivilegedFileHelper.createTempFile("Statistics" + category,
"-" + System.currentTimeMillis() + ".csv");
+ file =
+ PrivilegedFileHelper.createTempFile("Statistics" + category,
"-" + System.currentTimeMillis() + ".csv");
pw = new PrintWriter(file);
}
catch (IOException e1)
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/TextExtractorTest.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/TextExtractorTest.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/TextExtractorTest.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -18,14 +18,14 @@
import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
-import javax.jcr.Node;
+import java.io.BufferedInputStream;
import java.io.File;
import java.io.InputStream;
-import java.io.FileInputStream;
-import java.io.BufferedInputStream;
import java.net.URLConnection;
import java.util.Calendar;
+import javax.jcr.Node;
+
/**
* <code>TextExtractorTest</code> implements a file / folder import from the
* local file system.
@@ -39,7 +39,7 @@
public void testImport() throws Exception
{
- File sourceFolder = PrivilegedFileHelper.file(TEST_FOLDER);
+ File sourceFolder = new File(TEST_FOLDER);
// only run if there is test data
if (!sourceFolder.exists())
{
@@ -60,7 +60,7 @@
String[] names = folder.list();
for (int i = 0; i < names.length; i++)
{
- File f = PrivilegedFileHelper.file(folder, names[i]);
+ File f = new File(folder, names[i]);
if (f.canRead())
{
if (f.isDirectory())
@@ -88,7 +88,7 @@
*/
public void testRepeatedUpdate() throws Exception
{
- File testFile = PrivilegedFileHelper.file("test.pdf");
+ File testFile = new File("test.pdf");
if (!testFile.exists())
{
return;
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/directory/DirectoryManagerTest.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/directory/DirectoryManagerTest.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/directory/DirectoryManagerTest.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -23,7 +23,6 @@
import org.exoplatform.services.jcr.impl.core.query.lucene.directory.DirectoryManager;
import org.exoplatform.services.jcr.impl.core.query.lucene.directory.FSDirectoryManager;
import
org.exoplatform.services.jcr.impl.core.query.lucene.directory.RAMDirectoryManager;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import java.io.File;
import java.util.Arrays;
@@ -48,15 +47,14 @@
static
{
-
INDEX.setPath(PrivilegedFileHelper.file(PrivilegedFileHelper.file("target"),
"directory-factory-test")
- .getAbsolutePath());
+ INDEX.setPath(new File(new File("target"),
"directory-factory-test").getAbsolutePath());
}
@Override
protected void tearDown() throws Exception
{
- PrivilegedFileHelper.file(INDEX.getPath(), TEST).delete();
- PrivilegedFileHelper.file(INDEX.getPath(), RENAMED).delete();
+ new File(INDEX.getPath(), TEST).delete();
+ new File(INDEX.getPath(), RENAMED).delete();
}
public void testHasDirectory() throws Exception
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRestoreWorkspaceInitializer.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRestoreWorkspaceInitializer.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRestoreWorkspaceInitializer.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -23,7 +23,6 @@
import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Calendar;
@@ -71,9 +70,9 @@
root.save();
is.close();
- f.renameTo(PrivilegedFileHelper.file("./sv_export_binary.bin"));
+ f.renameTo(new File("./sv_export_binary.bin"));
- File outf = PrivilegedFileHelper.file("./sv_export_root.xml");
+ File outf = new File("./sv_export_root.xml");
FileOutputStream out = PrivilegedFileHelper.fileOutputStream(outf);
session.exportWorkspaceSystemView(out, false, false);
out.close();
@@ -120,8 +119,8 @@
p = multiv.getProperty("exojcrtest:multiValuedName");
p.getValues();
-
compareStream(PrivilegedFileHelper.fileInputStream("./sv_export_binary.bin"),
root.getNode("binaryTest").getProperty("blob")
- .getStream());
+
compareStream(PrivilegedFileHelper.fileInputStream("./sv_export_binary.bin"),
root.getNode("binaryTest")
+ .getProperty("blob").getStream());
}
catch (ValueFormatException e)
{
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestArabicSearch.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestArabicSearch.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestArabicSearch.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -49,7 +49,7 @@
public void testSearchWithEncodingParameter() throws Exception
{
- File file =
PrivilegedFileHelper.file("src/test/resources/ArabicUTF8.txt");
+ File file = new File("src/test/resources/ArabicUTF8.txt");
assertTrue("/test/resources/ArabicUTF8.txt not found", file.exists());
FileInputStream fis = PrivilegedFileHelper.fileInputStream(file);
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestDateSearch.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestDateSearch.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestDateSearch.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -48,7 +48,7 @@
public void testSearchDate() throws Exception
{
- File file = PrivilegedFileHelper.file("src/test/resources/test.xls");
+ File file = new File("src/test/resources/test.xls");
assertTrue("/test/resources/test.xls not found", file.exists());
FileInputStream fis = PrivilegedFileHelper.fileInputStream(file);
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestErrorMultithreading.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestErrorMultithreading.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestErrorMultithreading.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -19,7 +19,6 @@
import org.exoplatform.services.jcr.core.CredentialsImpl;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
-import org.exoplatform.services.jcr.impl.core.SessionImpl;
import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import org.exoplatform.services.jcr.util.IdGenerator;
@@ -76,7 +75,7 @@
public Session sess;
- File file =
PrivilegedFileHelper.file("src/test/resources/LARGE.txt");
+ File file = new File("src/test/resources/LARGE.txt");
public FileInputStream fis = null;
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestExcelFileSearch.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestExcelFileSearch.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestExcelFileSearch.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -45,7 +45,7 @@
public void testFindFileContent() throws Exception
{
- File file = PrivilegedFileHelper.file("src/test/resources/test.xls");
+ File file = new File("src/test/resources/test.xls");
assertTrue("/test/resources/book.xls not found", file.exists());
FileInputStream fis = PrivilegedFileHelper.fileInputStream(file);
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/security/TestSecurityRepositoryManagment.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/security/TestSecurityRepositoryManagment.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/security/TestSecurityRepositoryManagment.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -23,6 +23,7 @@
import org.exoplatform.services.jcr.core.ManageableRepository;
import
org.exoplatform.services.jcr.impl.dataflow.serialization.TesterItemsPersistenceListener;
+import java.io.FileNotFoundException;
import java.security.AccessControlException;
import java.security.PrivilegedExceptionAction;
@@ -34,7 +35,7 @@
{
private static String testWorkspaceName = "testWorkspace";
- public void testGetSystemSessionSuccess()
+ public void testGetSystemSessionSuccess() throws FileNotFoundException
{
PrivilegedExceptionAction<Object> action = new
PrivilegedExceptionAction<Object>()
{
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -46,9 +46,9 @@
private static final String FILE_NAME = "testFileCleaned";
- private File parentDir = PrivilegedFileHelper.file("./target");
+ private File parentDir = new File("./target");
- private File testFile = PrivilegedFileHelper.file(parentDir, FILE_NAME);
+ private File testFile = new File(parentDir, FILE_NAME);
private FileCleaner testCleaner;
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -31,7 +31,6 @@
import org.exoplatform.services.log.Log;
import java.io.File;
-import java.io.FileInputStream;
import java.io.InputStream;
/**
@@ -70,10 +69,10 @@
if (rootDir == null)
{
- rootDir = PrivilegedFileHelper.file("target/temp/values-test");
+ rootDir = new File("target/temp/values-test");
rootDir.mkdirs();
- PrivilegedFileHelper.file(rootDir, FileValueStorage.TEMP_DIR_NAME).mkdirs();
+ new File(rootDir, FileValueStorage.TEMP_DIR_NAME).mkdirs();
if (!rootDir.exists())
throw new Exception("Folder does not exist " +
rootDir.getAbsolutePath());
@@ -117,8 +116,7 @@
fch.commit();
File vsfile =
- PrivilegedFileHelper.file(rootDir,
fch.makeFilePath(vcas.getIdentifier(propertyId, 0),
- CASableIOSupport.HASHFILE_ORDERNUMBER)); // orderNum
+ new File(rootDir, fch.makeFilePath(vcas.getIdentifier(propertyId, 0),
CASableIOSupport.HASHFILE_ORDERNUMBER)); // orderNum
// =0
assertTrue("File should exists " + vsfile.getAbsolutePath(),
vsfile.exists());
@@ -239,8 +237,7 @@
fch.commit();
File vsfile =
- PrivilegedFileHelper.file(rootDir,
fch.makeFilePath(vcas.getIdentifier(propertyId, 0),
- CASableIOSupport.HASHFILE_ORDERNUMBER)); // orderNum
+ new File(rootDir, fch.makeFilePath(vcas.getIdentifier(propertyId, 0),
CASableIOSupport.HASHFILE_ORDERNUMBER)); // orderNum
// =0
fch.delete(propertyId);
@@ -324,8 +321,7 @@
fch.commit();
File vsfile =
- PrivilegedFileHelper.file(rootDir,
fch.makeFilePath(vcas.getIdentifier(propertyId, 15),
- CASableIOSupport.HASHFILE_ORDERNUMBER));
+ new File(rootDir, fch.makeFilePath(vcas.getIdentifier(propertyId, 15),
CASableIOSupport.HASHFILE_ORDERNUMBER));
assertTrue("File should exists " + vsfile.getAbsolutePath(),
vsfile.exists());
assertEquals("Storage size must be increased on size of ONE file ",
initialSize
@@ -355,8 +351,7 @@
fch.commit();
File vsfile =
- PrivilegedFileHelper.file(rootDir,
fch.makeFilePath(vcas.getIdentifier(propertyId, 15),
- CASableIOSupport.HASHFILE_ORDERNUMBER));
+ new File(rootDir, fch.makeFilePath(vcas.getIdentifier(propertyId, 15),
CASableIOSupport.HASHFILE_ORDERNUMBER));
assertTrue("File should exists " + vsfile.getAbsolutePath(),
vsfile.exists());
assertEquals("Storage size must be increased on size of ALL files ",
initialSize + addedSize,
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileIOChannel.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileIOChannel.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileIOChannel.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -27,7 +27,6 @@
import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
@@ -58,10 +57,10 @@
{
super.setUp();
- rootDir = PrivilegedFileHelper.file(PrivilegedFileHelper.file("target"),
"vs1");
+ rootDir = new File(new File("target"), "vs1");
rootDir.mkdirs();
- PrivilegedFileHelper.file(rootDir, FileValueStorage.TEMP_DIR_NAME).mkdirs();
+ new File(rootDir, FileValueStorage.TEMP_DIR_NAME).mkdirs();
if (!rootDir.exists())
throw new Exception("Folder does not exist " +
rootDir.getAbsolutePath());
@@ -72,7 +71,7 @@
{
byte[] buf = "0123456789".getBytes();
- File file = PrivilegedFileHelper.file(rootDir,
"testReadFromIOChannel0");
+ File file = new File(rootDir, "testReadFromIOChannel0");
PrivilegedFileHelper.deleteOnExit(file);
if (file.exists())
file.delete();
@@ -82,7 +81,7 @@
buf = "01234567890123456789".getBytes();
- file = PrivilegedFileHelper.file(rootDir, "testReadFromIOChannel1");
+ file = new File(rootDir, "testReadFromIOChannel1");
if (file.exists())
file.delete();
out = PrivilegedFileHelper.fileOutputStream(file);
@@ -136,11 +135,11 @@
}
channel.commit();
- assertTrue(PrivilegedFileHelper.file(rootDir,
"testWriteToIOChannel0").exists());
- assertTrue(PrivilegedFileHelper.file(rootDir,
"testWriteToIOChannel1").exists());
- assertTrue(PrivilegedFileHelper.file(rootDir,
"testWriteToIOChannel2").exists());
+ assertTrue(new File(rootDir, "testWriteToIOChannel0").exists());
+ assertTrue(new File(rootDir, "testWriteToIOChannel1").exists());
+ assertTrue(new File(rootDir, "testWriteToIOChannel2").exists());
- assertEquals(10, PrivilegedFileHelper.length(PrivilegedFileHelper.file(rootDir,
"testWriteToIOChannel0")));
+ assertEquals(10, PrivilegedFileHelper.length(new File(rootDir,
"testWriteToIOChannel0")));
channel.delete("testWriteToIOChannel");
channel.commit();
@@ -199,16 +198,16 @@
}
channel.commit();
- assertTrue(PrivilegedFileHelper.file(rootDir,
"testDeleteFromIOChannel0").exists());
- assertTrue(PrivilegedFileHelper.file(rootDir,
"testDeleteFromIOChannel1").exists());
- assertTrue(PrivilegedFileHelper.file(rootDir,
"testDeleteFromIOChannel2").exists());
+ assertTrue(new File(rootDir, "testDeleteFromIOChannel0").exists());
+ assertTrue(new File(rootDir, "testDeleteFromIOChannel1").exists());
+ assertTrue(new File(rootDir, "testDeleteFromIOChannel2").exists());
channel.delete("testDeleteFromIOChannel");
channel.commit();
- assertFalse(PrivilegedFileHelper.file(rootDir,
"testDeleteFromIOChannel0").exists());
- assertFalse(PrivilegedFileHelper.file(rootDir,
"testDeleteFromIOChannel1").exists());
- assertFalse(PrivilegedFileHelper.file(rootDir,
"testDeleteFromIOChannel2").exists());
+ assertFalse(new File(rootDir, "testDeleteFromIOChannel0").exists());
+ assertFalse(new File(rootDir, "testDeleteFromIOChannel1").exists());
+ assertFalse(new File(rootDir, "testDeleteFromIOChannel2").exists());
channel.delete("testDeleteFromIOChannel");
channel.commit();
@@ -237,7 +236,7 @@
}
channel.commit();
- File f = PrivilegedFileHelper.file(rootDir,
"testConcurrentReadFromIOChannel0");
+ File f = new File(rootDir, "testConcurrentReadFromIOChannel0");
if (!f.exists())
throw new Exception("File does not exist " + f.getAbsolutePath());
@@ -283,7 +282,7 @@
}
channel.commit();
- File f = PrivilegedFileHelper.file(rootDir,
"testDeleteLockedFileFromIOChannel0");
+ File f = new File(rootDir, "testDeleteLockedFileFromIOChannel0");
Probe p = new Probe(f);
p.start();
@@ -295,7 +294,7 @@
// removed by FileCleaner
//Thread.sleep(3000);
- f = PrivilegedFileHelper.file(rootDir,
"testDeleteLockedFileFromIOChannel0");
+ f = new File(rootDir, "testDeleteLockedFileFromIOChannel0");
// assertFalse(f.exists());
System.out.println(">>>>>>>>>>>>>"
+ f.canRead() + " " + f.exists() + " " + f.canWrite());
System.out.println(">>>>>>>>>>>>>"
+ PrivilegedFileHelper.fileInputStream(f).read());
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileValueIO.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileValueIO.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileValueIO.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -85,7 +85,7 @@
{
byte[] buf = "0123456789".getBytes();
- File file =
PrivilegedFileHelper.file("target/testReadByteArrayValueData");
+ File file = new File("target/testReadByteArrayValueData");
if (file.exists())
file.delete();
FileOutputStream out = PrivilegedFileHelper.fileOutputStream(file);
@@ -107,7 +107,7 @@
{
byte[] buf = "0123456789".getBytes();
- File file = PrivilegedFileHelper.file("target/testReadFileValueData");
+ File file = new File"target/testReadFileValueData");
if (file.exists())
file.delete();
FileOutputStream out = PrivilegedFileHelper.fileOutputStream(file);
@@ -136,7 +136,7 @@
{
byte[] buf = "0123456789".getBytes();
- File file = PrivilegedFileHelper.file("target/testWriteFileValueData");
+ File file = new File("target/testWriteFileValueData");
if (file.exists())
file.delete();
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/TestValueFileIOHelper.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/TestValueFileIOHelper.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/TestValueFileIOHelper.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -123,7 +123,7 @@
out.close();
}
- testDir = PrivilegedFileHelper.file("target/TestValueFileIOHelper");
+ testDir = new File("target/TestValueFileIOHelper");
testDir.mkdirs();
dest = PrivilegedFileHelper.createTempFile("vdftest", "",
testDir);
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestPersistedValueData.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestPersistedValueData.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestPersistedValueData.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -58,7 +58,7 @@
{
byte[] buf = "0123456789".getBytes();
- File file =
PrivilegedFileHelper.file("target/testCreateFileStreamValueData");
+ File file = new File("target/testCreateFileStreamValueData");
if (file.exists())
file.delete();
FileOutputStream out = PrivilegedFileHelper.fileOutputStream(file);
@@ -84,7 +84,7 @@
{
byte[] buf = "0123456789".getBytes();
- SwapFile file = SwapFile.get(PrivilegedFileHelper.file("target"),
"testIfFinalizeRemovesTempFileStreamValueData");
+ SwapFile file = SwapFile.get(new File("target"),
"testIfFinalizeRemovesTempFileStreamValueData");
//File file =
PrivilegedFileHelper.file("target/testIfFinalizeRemovesTempFileStreamValueData");
//if (file.exists())
// file.delete();
@@ -111,7 +111,7 @@
byte[] buf =
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
.getBytes();
- File file =
PrivilegedFileHelper.file("target/testConcurrentFileStreamValueDataReading");
+ File file = new File("target/testConcurrentFileStreamValueDataReading");
if (file.exists())
file.delete();
FileOutputStream out = PrivilegedFileHelper.fileOutputStream(file);
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueData.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueData.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueData.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -69,7 +69,7 @@
{
byte[] buf = "0123456789".getBytes();
- File file =
PrivilegedFileHelper.file("target/testCreateFileStreamTransientValueData");
+ File file = new File("target/testCreateFileStreamTransientValueData");
if (file.exists())
file.delete();
FileOutputStream out = PrivilegedFileHelper.fileOutputStream(file);
@@ -78,7 +78,7 @@
FileInputStream fs1 = PrivilegedFileHelper.fileInputStream(file);
TransientValueData vd =
- new TransientValueData(0, null, fs1, null, new FileCleaner(), 5,
PrivilegedFileHelper.file("target"), true);
+ new TransientValueData(0, null, fs1, null, new FileCleaner(), 5, new
File("target"), true);
// spool to file
InputStream fs2 = vd.getAsStream();
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueDataSpooling.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueDataSpooling.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueDataSpooling.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -32,8 +32,6 @@
import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.List;
@@ -54,7 +52,7 @@
private TransactionChangesLog cLog;
- private final File tmpdir =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"));
+ private final File tmpdir = new File(System.getProperty("java.io.tmpdir"));
private boolean haveValueStorage = false;
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestValueImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestValueImpl.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestValueImpl.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -45,7 +45,7 @@
public class TestValueImpl extends TestCase
{
- private File tempDirectory =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"));
+ private File tempDirectory = new
File(System.getProperty("java.io.tmpdir"));
private int maxFufferSize = 10;
@@ -53,7 +53,7 @@
{
byte[] buf = "012345678901234567890123456789".getBytes();
- File file = PrivilegedFileHelper.file("target/testNewBinaryValue");
+ File file = new File("target/testNewBinaryValue");
if (file.exists())
file.delete();
FileOutputStream out = PrivilegedFileHelper.fileOutputStream(file);
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/java/TestFileLock.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/java/TestFileLock.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/java/TestFileLock.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -18,10 +18,10 @@
*/
package org.exoplatform.services.jcr.lab.java;
+import junit.framework.TestCase;
+
import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
-import junit.framework.TestCase;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -45,7 +45,7 @@
public void _testSameJVMlLock() throws IOException, InterruptedException
{
- File f = PrivilegedFileHelper.file("\\\\storm\\public\\file1.tmp");
+ File f = new File("\\\\storm\\public\\file1.tmp");
f.createNewFile();
FileOutputStream fout = PrivilegedFileHelper.fileOutputStream(f);
FileChannel fc = fout.getChannel();
@@ -82,7 +82,7 @@
try
{
Thread.sleep(25);
- FileOutputStream fout1 =
PrivilegedFileHelper.fileOutputStream(PrivilegedFileHelper.file("\\\\storm\\public\\file1.tmp"));
+ FileOutputStream fout1 = PrivilegedFileHelper.fileOutputStream(new
File("\\\\storm\\public\\file1.tmp"));
FileChannel fc1 = fout1.getChannel();
try
{
@@ -135,7 +135,7 @@
final long timeout =
Long.valueOf(System.getProperty("exo.jcr.lab.testFileLockTimeout",
"20000"));
// File f = PrivilegedFileHelper.file("\\\\storm\\public\\file2.tmp");
- File f = PrivilegedFileHelper.file("D:\\tmp\\file2.tmp");
+ File f = new File("D:\\tmp\\file2.tmp");
System.out.println("Try open file for write " +
System.currentTimeMillis());
FileOutputStream fout = PrivilegedFileHelper.fileOutputStream(f);
@@ -218,7 +218,7 @@
final long timeout =
Long.valueOf(System.getProperty("exo.jcr.lab.testFileLockTimeout",
"20000"));
// File f = PrivilegedFileHelper.file("\\\\storm\\public\\file3.tmp");
- File f = PrivilegedFileHelper.file("D:\\tmp\\file3.tmp");
+ File f = new File("D:\\tmp\\file3.tmp");
// write new content
System.out.println("Try open file for write " +
System.currentTimeMillis());
@@ -263,7 +263,7 @@
{
// File f = PrivilegedFileHelper.file("\\\\storm\\public\\file3.tmp");
- File f = PrivilegedFileHelper.file("D:\\tmp\\file4.tmp");
+ File f = new File("D:\\tmp\\file4.tmp");
// write new content
System.out.println("Try open file for read " +
System.currentTimeMillis());
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/TestLoadRepo.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/TestLoadRepo.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/TestLoadRepo.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -28,8 +28,6 @@
import java.io.BufferedOutputStream;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -60,7 +58,7 @@
public void _testExport() throws Exception
{
Node testNode = root.addNode("testNode");
- File checkSummValue =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"),
"repo.ssh1");
+ File checkSummValue = new File(System.getProperty("java.io.tmpdir"),
"repo.ssh1");
BufferedOutputStream sshStrream = new
BufferedOutputStream(PrivilegedFileHelper.fileOutputStream(checkSummValue));
RandomValueNodeGenerator nodeGenerator =
new RandomValueNodeGenerator(session.getValueFactory(), 6, 5, 8, 5, 1024 *
1024);
@@ -70,7 +68,7 @@
ValueSsh1Generator ssh1Generator = new
ValueSsh1Generator(session.getTransientNodesManager(), sshStrream);
((NodeImpl)testNode).getData().accept(ssh1Generator);
sshStrream.close();
- File exportFile =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"),
"testExport.xml");
+ File exportFile = new File(System.getProperty("java.io.tmpdir"),
"testExport.xml");
OutputStream os = PrivilegedFileHelper.fileOutputStream(exportFile);
session.exportSystemView(testNode.getPath(), os, false, false);
os.close();
@@ -85,7 +83,7 @@
ConstraintViolationException, LockException, RepositoryException, IOException,
NoSuchAlgorithmException
{
- File importFile =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"),
"testExport.xml");
+ File importFile = new File(System.getProperty("java.io.tmpdir"),
"testExport.xml");
InputStream is = PrivilegedFileHelper.fileInputStream(importFile);
session.getWorkspace().getNamespaceRegistry().registerNamespace("exojcrtest_old",
@@ -93,7 +91,7 @@
session.importXML(root.getPath(), is,
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
session.save();
- File ssh1File =
PrivilegedFileHelper.file(System.getProperty("java.io.tmpdir"),
"repo.ssh1");
+ File ssh1File = new File(System.getProperty("java.io.tmpdir"),
"repo.ssh1");
InputStream isSSH1 = PrivilegedFileHelper.fileInputStream(ssh1File);
ValueSsh1Comparator ssh1Comparator = new
ValueSsh1Comparator(session.getTransientNodesManager(), isSSH1);
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/dataflow/persistent/TestGetNodesConcurrentModification.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/dataflow/persistent/TestGetNodesConcurrentModification.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/dataflow/persistent/TestGetNodesConcurrentModification.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -22,7 +22,6 @@
import org.exoplatform.services.jcr.JcrImplBaseTest;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
import java.io.File;
import java.io.IOException;
@@ -165,8 +164,7 @@
super.setUp();
fails = new ArrayList<String>();
- contentFile =
- new URL("file:///" +
PrivilegedFileHelper.file("src/test/resources/index/test_index.doc").getAbsolutePath());
+ contentFile = new URL("file:///" + new
File("src/test/resources/index/test_index.doc").getAbsolutePath());
initDB();
}
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf/TestBulkItemsAdd.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf/TestBulkItemsAdd.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf/TestBulkItemsAdd.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.services.jcr.load.perf;
+import org.exoplatform.services.jcr.JcrAPIBaseTest;
+
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.PrintWriter;
@@ -25,9 +27,6 @@
import javax.jcr.Node;
-import org.exoplatform.services.jcr.JcrAPIBaseTest;
-import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper;
-
/**
* Created by The eXo Platform SAS Author : Peter Nedonosko
peter.nedonosko(a)exoplatform.com.ua
* 20.07.2006
@@ -75,7 +74,7 @@
log.info("Nodes saved " + nodesCount + ", " +
(System.currentTimeMillis() - startTime) + "ms");
// save stats
- PrintWriter statFile = new
PrintWriter(PrivilegedFileHelper.file("stats.txt"));
+ PrintWriter statFile = new PrintWriter(new File("stats.txt"));
statFile.write(stats.toString());
statFile.close();
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/storage/fs/TestFSReadWrite.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/storage/fs/TestFSReadWrite.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/storage/fs/TestFSReadWrite.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -111,7 +111,7 @@
{
super.setUp();
- testRoot = PrivilegedFileHelper.file("target/fstest");
+ testRoot = new File("target/fstest");
testRoot.mkdirs();
PrivilegedFileHelper.deleteOnExit(testRoot);
}
@@ -137,7 +137,7 @@
for (File f : filesList)
{
f.delete();
- deleteFileParent(PrivilegedFileHelper.file(f.getParent()));
+ deleteFileParent(new File(f.getParent()));
}
}
@@ -151,7 +151,7 @@
{
// log.info("del " + fp.getAbsolutePath());
fp.delete();
- deleteFileParent(PrivilegedFileHelper.file(fp.getParent()));
+ deleteFileParent(new File(fp.getParent()));
}
}
else
@@ -168,7 +168,7 @@
}
for (String fn : ls)
{
- File f = PrivilegedFileHelper.file(dir.getAbsolutePath() + File.separator +
fn);
+ File f = new File(dir.getAbsolutePath() + File.separator + fn);
if (f.isDirectory())
{
deleteDir(f);
@@ -184,7 +184,7 @@
List<File> files = new ArrayList<File>();
for (int i = 0; i < FILES_COUNT; i++)
{
- File f = PrivilegedFileHelper.file(testRoot.getAbsolutePath() + File.separator +
SIDGenerator.generate());
+ File f = new File(testRoot.getAbsolutePath() + File.separator +
SIDGenerator.generate());
try
{
// f.createNewFile();
@@ -213,9 +213,9 @@
for (int i = 0; i < FILES_COUNT; i++)
{
String fileName = SIDGenerator.generate();
- File dir = PrivilegedFileHelper.file(testRoot.getAbsolutePath() +
buildPathX(fileName));
+ File dir = new File(testRoot.getAbsolutePath() + buildPathX(fileName));
dir.mkdirs();
- File f = PrivilegedFileHelper.file(dir.getAbsolutePath() + File.separator +
fileName);
+ File f = new File(dir.getAbsolutePath() + File.separator + fileName);
try
{
// f.createNewFile();
@@ -255,9 +255,9 @@
for (int i = 0; i < FILES_COUNT; i++)
{
String fileName = SIDGenerator.generate();
- File dir = PrivilegedFileHelper.file(testRoot.getAbsolutePath() +
buildPathXX(fileName));
+ File dir = new File(testRoot.getAbsolutePath() + buildPathXX(fileName));
dir.mkdirs();
- File f = PrivilegedFileHelper.file(dir.getAbsolutePath() + File.separator +
fileName);
+ File f = new File(dir.getAbsolutePath() + File.separator + fileName);
try
{
// f.createNewFile();
@@ -301,11 +301,9 @@
String fileName = SIDGenerator.generate();
String prefix = fileName.substring(0, 24); // time + addr hash prefix
String rnd = fileName.substring(24); // random name
- File dir =
- PrivilegedFileHelper.file(testRoot.getAbsolutePath() + File.separator +
prefix + File.separator
- + buildPathX(rnd));
+ File dir = new File(testRoot.getAbsolutePath() + File.separator + prefix +
File.separator + buildPathX(rnd));
dir.mkdirs();
- File f = PrivilegedFileHelper.file(dir.getAbsolutePath() + File.separator +
fileName);
+ File f = new File(dir.getAbsolutePath() + File.separator + fileName);
try
{
// f.createNewFile();
@@ -347,9 +345,9 @@
for (int i = 0; i < FILES_COUNT; i++)
{
String fileName = SIDGenerator.generate();
- File dir = PrivilegedFileHelper.file(testRoot.getAbsolutePath() + File.separator
+ buildPathX8(fileName));
+ File dir = new File(testRoot.getAbsolutePath() + File.separator +
buildPathX8(fileName));
dir.mkdirs();
- File f = PrivilegedFileHelper.file(dir.getAbsolutePath() + File.separator +
fileName);
+ File f = new File(dir.getAbsolutePath() + File.separator + fileName);
try
{
FileOutputStream fos = PrivilegedFileHelper.fileOutputStream(f);
@@ -384,7 +382,7 @@
String[] ls = filter != null ? root.list(filter) : root.list();
for (String file : ls)
{
- File f = PrivilegedFileHelper.file(testRoot.getAbsolutePath() + File.separator +
file);
+ File f = new File(testRoot.getAbsolutePath() + File.separator + file);
if (f.isDirectory())
{
// dir
@@ -420,7 +418,7 @@
protected void readTreeXFiles(File root, NameFilter filter)
{
String dirPath = root.getAbsolutePath() + buildPathX(filter.getName());
- File dir = PrivilegedFileHelper.file(dirPath);
+ File dir = new File(dirPath);
String[] ls = filter != null ? dir.list(filter) : dir.list();
if (ls == null)
{
@@ -430,7 +428,7 @@
for (String file : ls)
{
- File f = PrivilegedFileHelper.file(dir.getAbsolutePath() + File.separator +
file);
+ File f = new File(dir.getAbsolutePath() + File.separator + file);
if (f.isDirectory())
{
// dir
@@ -459,7 +457,7 @@
protected void readTreeX8Files(File root, NameFilter filter)
{
String dirPath = root.getAbsolutePath() + buildPathX8(filter.getName());
- File dir = PrivilegedFileHelper.file(dirPath);
+ File dir = new File(dirPath);
String[] ls = filter != null ? dir.list(filter) : dir.list();
if (ls == null)
{
@@ -469,7 +467,7 @@
for (String file : ls)
{
- File f = PrivilegedFileHelper.file(dir.getAbsolutePath() + File.separator +
file);
+ File f = new File(dir.getAbsolutePath() + File.separator + file);
if (f.isDirectory())
{
// dir
@@ -503,7 +501,7 @@
protected void readTreeXXFiles(File root, NameFilter filter)
{
String dirPath = root.getAbsolutePath() + buildPathXX(filter.getName());
- File dir = PrivilegedFileHelper.file(dirPath);
+ File dir = new File(dirPath);
String[] ls = filter != null ? dir.list(filter) : dir.list();
if (ls == null)
{
@@ -513,7 +511,7 @@
for (String file : ls)
{
- File f = PrivilegedFileHelper.file(dir.getAbsolutePath() + File.separator +
file);
+ File f = new File(dir.getAbsolutePath() + File.separator + file);
if (f.isDirectory())
{
// dir
@@ -549,9 +547,7 @@
String fileName = filter.getName();
String prefix = fileName.substring(0, 24); // time + addr hash prefix
String rnd = fileName.substring(24); // random name
- File dir =
- PrivilegedFileHelper.file(testRoot.getAbsolutePath() + File.separator + prefix +
File.separator
- + buildPathX(rnd));
+ File dir = new File(testRoot.getAbsolutePath() + File.separator + prefix +
File.separator + buildPathX(rnd));
String[] ls = filter != null ? dir.list(filter) : dir.list();
if (ls == null)
{
@@ -561,7 +557,7 @@
for (String file : ls)
{
- File f = PrivilegedFileHelper.file(dir.getAbsolutePath() + File.separator +
file);
+ File f = new File(dir.getAbsolutePath() + File.separator + file);
if (f.isDirectory())
{
// dir
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/usecases/export/ExportWorkspaceSystemViewTest.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/usecases/export/ExportWorkspaceSystemViewTest.java 2010-06-14
09:00:21 UTC (rev 2566)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/usecases/export/ExportWorkspaceSystemViewTest.java 2010-06-14
09:24:14 UTC (rev 2567)
@@ -31,7 +31,6 @@
import org.exoplatform.services.jcr.usecases.BaseUsecasesTest;
import java.io.File;
-import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -56,7 +55,7 @@
sessionWS1.save();
// 1-st export
- File f1 = PrivilegedFileHelper.file("target/1.xml");
+ File f1 = new File("target/1.xml");
sessionWS1.exportWorkspaceSystemView(PrivilegedFileHelper.fileOutputStream(f1),
false, false);
// 1-st import
@@ -77,7 +76,7 @@
{
// 2-st export
SessionImpl back1 = (SessionImpl)repository.login(credentials,
"ws1_restore_1");
- File f2 = PrivilegedFileHelper.file("target/2.xml");
+ File f2 = new File("target/2.xml");
back1.exportWorkspaceSystemView(PrivilegedFileHelper.fileOutputStream(f2),
false, false);
// 2-st import