|
|
|
@ -94,13 +94,14 @@ public Iterator<HistoryID> getExistingIDs()
|
|
|
|
List<File> vect = new Vector<File>();
|
|
|
|
List<File> vect = new Vector<File>();
|
|
|
|
File histDir = null;
|
|
|
|
File histDir = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String userSetDataDirectory = System.getProperty("HistoryServiceDirectory");
|
|
|
|
String userSetDataDirectory
|
|
|
|
if(userSetDataDirectory != null)
|
|
|
|
= System.getProperty("HistoryServiceDirectory");
|
|
|
|
histDir = this.fileAccessService
|
|
|
|
|
|
|
|
.getPrivatePersistentDirectory(userSetDataDirectory);
|
|
|
|
histDir
|
|
|
|
else
|
|
|
|
= getFileAccessService().getPrivatePersistentDirectory(
|
|
|
|
histDir = this.fileAccessService
|
|
|
|
(userSetDataDirectory == null)
|
|
|
|
.getPrivatePersistentDirectory(DATA_DIRECTORY);
|
|
|
|
? DATA_DIRECTORY
|
|
|
|
|
|
|
|
: userSetDataDirectory);
|
|
|
|
|
|
|
|
|
|
|
|
findDatFiles(vect, histDir);
|
|
|
|
findDatFiles(vect, histDir);
|
|
|
|
} catch (Exception e)
|
|
|
|
} catch (Exception e)
|
|
|
|
@ -259,15 +260,20 @@ private File createHistoryDirectories(HistoryID id)
|
|
|
|
System.arraycopy(idComponents, 0, dirs, 1, dirs.length - 1);
|
|
|
|
System.arraycopy(idComponents, 0, dirs, 1, dirs.length - 1);
|
|
|
|
|
|
|
|
|
|
|
|
File directory = null;
|
|
|
|
File directory = null;
|
|
|
|
try {
|
|
|
|
try
|
|
|
|
directory = this.fileAccessService
|
|
|
|
|
|
|
|
.getPrivatePersistentDirectory(dirs);
|
|
|
|
|
|
|
|
} catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw (IOException) new IOException(
|
|
|
|
directory
|
|
|
|
"Could not create history due to file system error")
|
|
|
|
= getFileAccessService().getPrivatePersistentDirectory(dirs);
|
|
|
|
.initCause(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
IOException ioe
|
|
|
|
|
|
|
|
= new IOException(
|
|
|
|
|
|
|
|
"Could not create history due to file system error");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ioe.initCause(e);
|
|
|
|
|
|
|
|
throw ioe;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!directory.exists() && !directory.mkdirs())
|
|
|
|
if (!directory.exists() && !directory.mkdirs())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -363,13 +369,9 @@ private static ConfigurationService getConfigurationService(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static FileAccessService getFileAccessService(
|
|
|
|
private static FileAccessService getFileAccessService(
|
|
|
|
BundleContext bundleContext)
|
|
|
|
BundleContext bundleContext)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ServiceReference serviceReference =
|
|
|
|
return ServiceUtils.getService(bundleContext, FileAccessService.class);
|
|
|
|
bundleContext
|
|
|
|
|
|
|
|
.getServiceReference(FileAccessService.class.getName());
|
|
|
|
|
|
|
|
return (serviceReference == null) ? null
|
|
|
|
|
|
|
|
: (FileAccessService) bundleContext.getService(serviceReference);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -416,9 +418,7 @@ private File getDirForHistory(HistoryID id)
|
|
|
|
for (int i = 0; i < dirNames.length; i++)
|
|
|
|
for (int i = 0; i < dirNames.length; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (i > 0)
|
|
|
|
if (i > 0)
|
|
|
|
{
|
|
|
|
|
|
|
|
dirName.append(File.separatorChar);
|
|
|
|
dirName.append(File.separatorChar);
|
|
|
|
}
|
|
|
|
|
|
|
|
dirName.append(dirNames[i]);
|
|
|
|
dirName.append(dirNames[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -426,18 +426,16 @@ private File getDirForHistory(HistoryID id)
|
|
|
|
File histDir = null;
|
|
|
|
File histDir = null;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String userSetDataDirectory =
|
|
|
|
String userSetDataDirectory
|
|
|
|
System.getProperty("HistoryServiceDirectory");
|
|
|
|
= System.getProperty("HistoryServiceDirectory");
|
|
|
|
|
|
|
|
|
|
|
|
if(userSetDataDirectory != null)
|
|
|
|
histDir
|
|
|
|
histDir = this.fileAccessService
|
|
|
|
= getFileAccessService().getPrivatePersistentDirectory(
|
|
|
|
.getPrivatePersistentDirectory(userSetDataDirectory);
|
|
|
|
(userSetDataDirectory == null)
|
|
|
|
else
|
|
|
|
? DATA_DIRECTORY
|
|
|
|
histDir = this.fileAccessService
|
|
|
|
: userSetDataDirectory);
|
|
|
|
.getPrivatePersistentDirectory(DATA_DIRECTORY);
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
logger.error("Error opening directory", e);
|
|
|
|
logger.error("Error opening directory", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|