You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2011/10/03 01:36:12 UTC
svn commit: r1178278 - in /incubator/lcf/trunk:
framework/core/src/main/java/org/apache/manifoldcf/core/database/
tests/cmis/ tests/filesystem/
Author: kwright
Date: Sun Oct 2 23:36:11 2011
New Revision: 1178278
URL: http://svn.apache.org/viewvc?rev=1178278&view=rev
Log:
Explicitly specify working path in poms, and improve the database cleanup logic for HSQLDB and Derby.
Modified:
incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java
incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
incubator/lcf/trunk/tests/cmis/pom.xml
incubator/lcf/trunk/tests/filesystem/pom.xml
Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java?rev=1178278&r1=1178277&r2=1178278&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java (original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java Sun Oct 2 23:36:11 2011
@@ -767,13 +767,19 @@ public class DBInterfaceDerby extends Da
if (newf.isDirectory())
recursiveDelete(newf);
else
- newf.delete();
+ singleDelete(newf);
}
}
if (!f.delete())
- System.out.println("Failed to delete file "+f.toString());
+ System.out.println("Failed to delete directory "+f.toString());
}
+ protected static void singleDelete(File f)
+ {
+ if (!f.delete())
+ System.out.println("Failed to delete file "+f.toString());
+ }
+
/** Reinterpret an exception tossed by the database layer. We need to disambiguate the various kinds of exception that
* should be thrown.
*@param theException is the exception to reinterpret
Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java?rev=1178278&r1=1178277&r2=1178278&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java (original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java Sun Oct 2 23:36:11 2011
@@ -105,6 +105,7 @@ public class DBInterfaceHSQLDB extends D
catch (Exception e)
{
// Never any exception!
+ e.printStackTrace();
}
}
@@ -524,7 +525,7 @@ public class DBInterfaceHSQLDB extends D
public void dropUserAndDatabase(String adminUserName, String adminPassword, StringSet invalidateKeys)
throws ManifoldCFException
{
- File f = new File(databaseName);
+ File f = new File(databaseName + ".properties");
if (f.exists())
{
// Try to guarantee that all connections are discarded before we shut the database down. Otherwise we get pool warnings from bitstream.
@@ -532,7 +533,12 @@ public class DBInterfaceHSQLDB extends D
// Make sure database is shut down.
closeDatabase();
// Now, it's OK to delete
- recursiveDelete(f);
+ singleDelete(f);
+ singleDelete(new File(databaseName + ".data"));
+ singleDelete(new File(databaseName + ".lck"));
+ singleDelete(new File(databaseName + ".log"));
+ singleDelete(new File(databaseName + ".script"));
+ recursiveDelete(new File(databaseName + ".tmp"));
}
}
@@ -548,13 +554,19 @@ public class DBInterfaceHSQLDB extends D
if (newf.isDirectory())
recursiveDelete(newf);
else
- newf.delete();
+ singleDelete(newf);
}
}
if (!f.delete())
- System.out.println("Failed to delete file "+f.toString());
+ System.out.println("Failed to delete directory "+f.toString());
}
+ protected static void singleDelete(File f)
+ {
+ if (!f.delete())
+ System.out.println("Failed to delete file "+f.toString());
+ }
+
/** Reinterpret an exception tossed by the database layer. We need to disambiguate the various kinds of exception that
* should be thrown.
*@param theException is the exception to reinterpret
Modified: incubator/lcf/trunk/tests/cmis/pom.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/cmis/pom.xml?rev=1178278&r1=1178277&r2=1178278&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/cmis/pom.xml (original)
+++ incubator/lcf/trunk/tests/cmis/pom.xml Sun Oct 2 23:36:11 2011
@@ -100,6 +100,7 @@
<exclude>**/*Postgresql*.java</exclude>
</excludes>
<forkMode>always</forkMode>
+ <workingDirectory>.</workingDirectory>
</configuration>
</plugin>
</plugins>
Modified: incubator/lcf/trunk/tests/filesystem/pom.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/pom.xml?rev=1178278&r1=1178277&r2=1178278&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/pom.xml (original)
+++ incubator/lcf/trunk/tests/filesystem/pom.xml Sun Oct 2 23:36:11 2011
@@ -83,6 +83,7 @@
<exclude>**/*Postgresql*.java</exclude>
</excludes>
<forkMode>always</forkMode>
+ <workingDirectory>.</workingDirectory>
</configuration>
</plugin>