You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/06/11 17:39:46 UTC
svn commit: r953733 - in /subversion/trunk/subversion/bindings/javahl:
native/ src/org/apache/subversion/javahl/ src/org/tigris/subversion/javahl/
tests/org/apache/subversion/javahl/
Author: hwright
Date: Fri Jun 11 15:39:46 2010
New Revision: 953733
URL: http://svn.apache.org/viewvc?rev=953733&view=rev
Log:
JavaHL: Extend the use of the File class when dealing with local paths to
all of the SVNAdmin APIs.
[ in subversion/bindings/javahl/ ]
* tests/org/apache/subversion/javahl/SVNAdminTests.java
(testSetRevProp, testLoadRepo): Update callers.
* tests/org/apache/subversion/javahl/SVNTests.java
(dump): Update caller.
(getRepositoryPath): Remove.
(createInitialRepository): Update caller.
* native/SVNAdmin.cpp,
native/SVNAdmin.h:
Update APIs to use the File object, and check and convert it as needed.
* native/org_apache_subversion_javahl_SVNAdmin.cpp:
Update APIs to convert the incoming Java File object to a C++ File.
* src/org/apache/subversion/javahl/ISVNAdmin.java,
src/org/apache/subversion/javahl/SVNAdmin.java:
Everywhere we use a String to represent a path, use a File instead.
* src/org/tigris/subversion/javahl/SVNAdmin.java:
Update backward compat wrappers to use Files.
Modified:
subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.cpp
subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.h
subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNAdmin.cpp
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNAdmin.java
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNAdmin.java
subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java
subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNAdminTests.java
subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
Modified: subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.cpp?rev=953733&r1=953732&r2=953733&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.cpp Fri Jun 11 15:39:46 2010
@@ -91,19 +91,24 @@ void SVNAdmin::create(File &path, bool d
requestPool.pool()), );
}
-void SVNAdmin::deltify(const char *path, Revision &revStart, Revision &revEnd)
+void SVNAdmin::deltify(File &path, Revision &revStart, Revision &revEnd)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
- path = svn_dirent_internal_style(path, requestPool.pool());
svn_repos_t *repos;
svn_fs_t *fs;
svn_revnum_t start = SVN_INVALID_REVNUM, end = SVN_INVALID_REVNUM;
svn_revnum_t youngest, revision;
SVN::Pool revisionPool;
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), );
- fs = svn_repos_fs (repos);
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), );
+ fs = svn_repos_fs(repos);
SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.pool()), );
if (revStart.revision()->kind == svn_opt_revision_number)
@@ -153,21 +158,26 @@ void SVNAdmin::deltify(const char *path,
return;
}
-void SVNAdmin::dump(const char *path, OutputStream &dataOut,
+void SVNAdmin::dump(File &path, OutputStream &dataOut,
OutputStream &messageOut,
Revision &revsionStart, Revision &revisionEnd,
bool incremental, bool useDeltas)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
- path = svn_dirent_internal_style(path, requestPool.pool());
svn_repos_t *repos;
svn_fs_t *fs;
svn_revnum_t lower = SVN_INVALID_REVNUM, upper = SVN_INVALID_REVNUM;
svn_revnum_t youngest;
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), );
- fs = svn_repos_fs (repos);
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), );
+ fs = svn_repos_fs(repos);
SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.pool()), );
/* ### We only handle revision numbers right now, not dates. */
@@ -216,36 +226,51 @@ void SVNAdmin::dump(const char *path, Ou
NULL, NULL, requestPool.pool()), );
}
-void SVNAdmin::hotcopy(const char *path, const char *targetPath,
+void SVNAdmin::hotcopy(File &path, File &targetPath,
bool cleanLogs)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
- SVN_JNI_NULL_PTR_EX(targetPath, "targetPath", );
- path = svn_dirent_internal_style(path, requestPool.pool());
- targetPath = svn_dirent_internal_style(targetPath, requestPool.pool());
- SVN_JNI_ERR(svn_repos_hotcopy(path, targetPath, cleanLogs,
- requestPool.pool()), );
+
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
+ if (targetPath.isNull())
+ {
+ JNIUtil::throwNullPointerException("targetPath");
+ return;
+ }
+
+ SVN_JNI_ERR(svn_repos_hotcopy(path.getInternalStyle(requestPool),
+ targetPath.getInternalStyle(requestPool),
+ cleanLogs, requestPool.pool()), );
}
static void
-list_dblogs (const char *path, MessageReceiver &receiver, bool only_unused)
+list_dblogs (File &path, MessageReceiver &receiver, bool only_unused)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
- path = svn_dirent_internal_style(path, requestPool.pool());
apr_array_header_t *logfiles;
- int i;
- SVN_JNI_ERR(svn_repos_db_logfiles(&logfiles, path, only_unused,
- requestPool.pool()), );
+
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
+ SVN_JNI_ERR(svn_repos_db_logfiles(&logfiles,
+ path.getInternalStyle(requestPool),
+ only_unused, requestPool.pool()), );
/* Loop, printing log files. We append the log paths to the
* repository path, making sure to return everything to the native
* style and encoding before printing. */
- for (i = 0; i < logfiles->nelts; ++i)
+ for (int i = 0; i < logfiles->nelts; ++i)
{
const char *log_utf8;
- log_utf8 = svn_dirent_join(path,
+ log_utf8 = svn_dirent_join(path.getInternalStyle(requestPool),
APR_ARRAY_IDX(logfiles, i, const char *),
requestPool.pool());
log_utf8 = svn_dirent_local_style (log_utf8, requestPool.pool());
@@ -253,18 +278,18 @@ list_dblogs (const char *path, MessageRe
}
}
-void SVNAdmin::listDBLogs(const char *path, MessageReceiver &messageReceiver)
+void SVNAdmin::listDBLogs(File &path, MessageReceiver &messageReceiver)
{
list_dblogs(path, messageReceiver, false);
}
-void SVNAdmin::listUnusedDBLogs(const char *path,
+void SVNAdmin::listUnusedDBLogs(File &path,
MessageReceiver &messageReceiver)
{
list_dblogs(path, messageReceiver, true);
}
-void SVNAdmin::load(const char *path,
+void SVNAdmin::load(File &path,
InputStream &dataIn,
OutputStream &messageOut,
bool ignoreUUID,
@@ -274,15 +299,21 @@ void SVNAdmin::load(const char *path,
const char *relativePath)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
- path = svn_dirent_internal_style(path, requestPool.pool());
svn_repos_t *repos;
enum svn_repos_load_uuid uuid_action = svn_repos_load_uuid_default;
if (ignoreUUID)
uuid_action = svn_repos_load_uuid_ignore;
else if (forceUUID)
uuid_action = svn_repos_load_uuid_force;
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), );
+
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), );
SVN_JNI_ERR(svn_repos_load_fs2(repos, dataIn.getStream(requestPool),
messageOut.getStream(requestPool),
@@ -291,22 +322,26 @@ void SVNAdmin::load(const char *path,
NULL, NULL, requestPool.pool()), );
}
-void SVNAdmin::lstxns(const char *path, MessageReceiver &messageReceiver)
+void SVNAdmin::lstxns(File &path, MessageReceiver &messageReceiver)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
- path = svn_dirent_internal_style(path, requestPool.pool());
svn_repos_t *repos;
svn_fs_t *fs;
apr_array_header_t *txns;
- int i;
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), );
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), );
fs = svn_repos_fs (repos);
SVN_JNI_ERR(svn_fs_list_transactions(&txns, fs, requestPool.pool()), );
/* Loop, printing revisions. */
- for (i = 0; i < txns->nelts; ++i)
+ for (int i = 0; i < txns->nelts; ++i)
{
messageReceiver.receiveMessage(APR_ARRAY_IDX (txns, i, const char *));
}
@@ -314,33 +349,36 @@ void SVNAdmin::lstxns(const char *path,
}
-jlong SVNAdmin::recover(const char *path)
+jlong SVNAdmin::recover(File &path)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", -1);
- path = svn_dirent_internal_style(path, requestPool.pool());
svn_revnum_t youngest_rev;
svn_repos_t *repos;
- SVN_JNI_ERR(svn_repos_recover3(path, FALSE, NULL, NULL, NULL, NULL,
- requestPool.pool()),
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return -1;
+ }
+
+ SVN_JNI_ERR(svn_repos_recover3(path.getInternalStyle(requestPool), FALSE,
+ NULL, NULL, NULL, NULL, requestPool.pool()),
-1);
/* Since db transactions may have been replayed, it's nice to tell
* people what the latest revision is. It also proves that the
* recovery actually worked. */
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), -1);
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), -1);
SVN_JNI_ERR(svn_fs_youngest_rev(&youngest_rev, svn_repos_fs (repos),
requestPool.pool()),
-1);
return youngest_rev;
}
-void SVNAdmin::rmtxns(const char *path, StringArray &transactions)
+void SVNAdmin::rmtxns(File &path, StringArray &transactions)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
- path = svn_dirent_internal_style(path, requestPool.pool());
svn_repos_t *repos;
svn_fs_t *fs;
svn_fs_txn_t *txn;
@@ -348,7 +386,14 @@ void SVNAdmin::rmtxns(const char *path,
int i;
SVN::Pool transactionPool;
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), );
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), );
fs = svn_repos_fs (repos);
args = transactions.array(requestPool);
@@ -382,13 +427,12 @@ void SVNAdmin::rmtxns(const char *path,
}
-void SVNAdmin::setRevProp(const char *path, Revision &revision,
+void SVNAdmin::setRevProp(File &path, Revision &revision,
const char *propName, const char *propValue,
bool usePreRevPropChangeHook,
bool usePostRevPropChangeHook)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(propName, "propName", );
SVN_JNI_NULL_PTR_EX(propValue, "propValue", );
if (revision.revision()->kind != svn_opt_revision_number)
@@ -397,10 +441,16 @@ void SVNAdmin::setRevProp(const char *pa
_("Missing revision")), );
}
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
/* Open the filesystem. */
svn_repos_t *repos;
- path = svn_dirent_internal_style(path, requestPool.pool());
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), );
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), );
/* If we are bypassing the hooks system, we just hit the filesystem
* directly. */
@@ -455,19 +505,24 @@ SVNAdmin::getRevnum(svn_revnum_t *revnum
return SVN_NO_ERROR;
}
-void SVNAdmin::verify(const char *path, OutputStream &messageOut,
+void SVNAdmin::verify(File &path, OutputStream &messageOut,
Revision &revisionStart, Revision &revisionEnd)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
- path = svn_dirent_internal_style(path, requestPool.pool());
svn_repos_t *repos;
svn_revnum_t lower = SVN_INVALID_REVNUM, upper = SVN_INVALID_REVNUM;
svn_revnum_t youngest;
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
/* This whole process is basically just a dump of the repository
* with no interest in the output. */
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), );
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), );
SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, svn_repos_fs (repos),
requestPool.pool()), );
@@ -499,17 +554,22 @@ void SVNAdmin::verify(const char *path,
requestPool.pool()), );
}
-jobject SVNAdmin::lslocks(const char *path)
+jobject SVNAdmin::lslocks(File &path)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", NULL);
- path = svn_dirent_internal_style(path, requestPool.pool());
svn_repos_t *repos;
svn_fs_t *fs;
apr_hash_t *locks;
apr_hash_index_t *hi;
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), NULL);
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return NULL;
+ }
+
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), NULL);
fs = svn_repos_fs (repos);
/* Fetch all locks on or below the root directory. */
SVN_JNI_ERR(svn_repos_fs_get_locks(&locks, repos, "/", NULL, NULL,
@@ -540,17 +600,22 @@ jobject SVNAdmin::lslocks(const char *pa
return CreateJ::Set(jlocks);
}
-void SVNAdmin::rmlocks(const char *path, StringArray &locks)
+void SVNAdmin::rmlocks(File &path, StringArray &locks)
{
SVN::Pool requestPool;
apr_pool_t *pool = requestPool.pool();
- SVN_JNI_NULL_PTR_EX(path, "path", );
- path = svn_dirent_internal_style(path, requestPool.pool());
svn_repos_t *repos;
svn_fs_t *fs;
svn_fs_access_t *access;
- SVN_JNI_ERR(svn_repos_open(&repos, path, requestPool.pool()), );
+ if (path.isNull())
+ {
+ JNIUtil::throwNullPointerException("path");
+ return;
+ }
+
+ SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
+ requestPool.pool()), );
fs = svn_repos_fs (repos);
const char *username;
Modified: subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.h?rev=953733&r1=953732&r2=953733&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNAdmin.h Fri Jun 11 15:39:46 2010
@@ -40,28 +40,28 @@
class SVNAdmin : public SVNBase
{
public:
- void rmlocks(const char *path, StringArray &locks);
- jobject lslocks(const char *path);
- void verify(const char *path, OutputStream &messageOut,
+ void rmlocks(File &path, StringArray &locks);
+ jobject lslocks(File &path);
+ void verify(File &path, OutputStream &messageOut,
Revision &revisionStart, Revision &revisionEnd);
- void setRevProp(const char *path, Revision &revision,
+ void setRevProp(File &path, Revision &revision,
const char *propName, const char *propValue,
bool usePreRevPropChangeHook,
bool usePostRevPropChangeHook);
- void rmtxns(const char *path, StringArray &transactions);
- jlong recover(const char *path);
- void lstxns(const char *path, MessageReceiver &messageReceiver);
- void load(const char *path, InputStream &dataIn, OutputStream &messageOut,
+ void rmtxns(File &path, StringArray &transactions);
+ jlong recover(File &path);
+ void lstxns(File &path, MessageReceiver &messageReceiver);
+ void load(File &path, InputStream &dataIn, OutputStream &messageOut,
bool ignoreUUID, bool forceUUID, bool usePreCommitHook,
bool usePostCommitHook, const char *relativePath);
- void listUnusedDBLogs(const char *path,
+ void listUnusedDBLogs(File &path,
MessageReceiver &messageReceiver);
- void listDBLogs(const char *path, MessageReceiver &messageReceiver);
- void hotcopy(const char *path, const char *targetPath, bool cleanLogs);
- void dump(const char *path, OutputStream &dataOut, OutputStream &messageOut,
+ void listDBLogs(File &path, MessageReceiver &messageReceiver);
+ void hotcopy(File &path, File &targetPath, bool cleanLogs);
+ void dump(File &path, OutputStream &dataOut, OutputStream &messageOut,
Revision &revsionStart, Revision &RevisionEnd,
bool incremental, bool useDeltas);
- void deltify(const char *path, Revision &start, Revision &end);
+ void deltify(File &path, Revision &start, Revision &end);
void create(File &path, bool ignoreUUID, bool forceUUID, File &configPath,
const char *fstype);
SVNAdmin();
Modified: subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNAdmin.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNAdmin.cpp?rev=953733&r1=953732&r2=953733&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNAdmin.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNAdmin.cpp Fri Jun 11 15:39:46 2010
@@ -102,7 +102,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_deltify
-(JNIEnv *env, jobject jthis, jstring jpath, jobject jrevisionStart,
+(JNIEnv *env, jobject jthis, jobject jpath, jobject jrevisionStart,
jobject jrevisionStop)
{
JNIEntry(SVNAdmin, deltify);
@@ -113,7 +113,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
@@ -130,7 +130,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_dump
-(JNIEnv *env, jobject jthis, jstring jpath, jobject jdataout,
+(JNIEnv *env, jobject jthis, jobject jpath, jobject jdataout,
jobject jmessageout, jobject jrevisionStart, jobject jrevisionEnd,
jboolean jincremental, jboolean juseDeltas)
{
@@ -142,7 +142,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
@@ -168,7 +168,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_hotcopy
-(JNIEnv *env, jobject jthis, jstring jpath, jstring jtargetPath,
+(JNIEnv *env, jobject jthis, jobject jpath, jobject jtargetPath,
jboolean jcleanLogs)
{
JNIEntry(SVNAdmin, hotcopy);
@@ -179,11 +179,11 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
- JNIStringHolder targetPath(jtargetPath);
+ File targetPath(jtargetPath);
if (JNIUtil::isExceptionThrown())
return;
@@ -192,7 +192,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_listDBLogs
-(JNIEnv *env, jobject jthis, jstring jpath, jobject jreceiver)
+(JNIEnv *env, jobject jthis, jobject jpath, jobject jreceiver)
{
JNIEntry(SVNAdmin, listDBLogs);
SVNAdmin *cl = SVNAdmin::getCppObject(jthis);
@@ -202,7 +202,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
@@ -215,7 +215,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_listUnusedDBLogs
-(JNIEnv *env, jobject jthis, jstring jpath, jobject jreceiver)
+(JNIEnv *env, jobject jthis, jobject jpath, jobject jreceiver)
{
JNIEntry(SVNAdmin, listUnusedDBLogs);
SVNAdmin *cl = SVNAdmin::getCppObject(jthis);
@@ -225,7 +225,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
@@ -238,7 +238,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_load
-(JNIEnv *env, jobject jthis, jstring jpath, jobject jinputData,
+(JNIEnv *env, jobject jthis, jobject jpath, jobject jinputData,
jobject joutputMsg, jboolean jignoreUUID, jboolean jforceUUID,
jboolean jusePreCommitHook, jboolean jusePostCommitHook, jstring jrelativePath)
{
@@ -250,7 +250,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
@@ -274,7 +274,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_lstxns
-(JNIEnv *env, jobject jthis, jstring jpath, jobject jmessageReceiver)
+(JNIEnv *env, jobject jthis, jobject jpath, jobject jmessageReceiver)
{
JNIEntry(SVNAdmin, lstxns);
SVNAdmin *cl = SVNAdmin::getCppObject(jthis);
@@ -284,7 +284,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
@@ -297,7 +297,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT jlong JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_recover
-(JNIEnv *env, jobject jthis, jstring jpath)
+(JNIEnv *env, jobject jthis, jobject jpath)
{
JNIEntry(SVNAdmin, recover);
SVNAdmin *cl = SVNAdmin::getCppObject(jthis);
@@ -307,7 +307,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return -1;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return -1;
@@ -316,7 +316,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_rmtxns
-(JNIEnv *env, jobject jthis, jstring jpath, jobjectArray jtransactions)
+(JNIEnv *env, jobject jthis, jobject jpath, jobjectArray jtransactions)
{
JNIEntry(SVNAdmin, rmtxns);
SVNAdmin *cl = SVNAdmin::getCppObject(jthis);
@@ -326,7 +326,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
@@ -339,7 +339,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_setRevProp
-(JNIEnv *env, jobject jthis, jstring jpath, jobject jrevision,
+(JNIEnv *env, jobject jthis, jobject jpath, jobject jrevision,
jstring jpropName, jstring jpropValue, jboolean jusePreRevPropChangeHook,
jboolean jusePostRevPropChangeHook)
{
@@ -351,7 +351,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
@@ -374,7 +374,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_verify
-(JNIEnv *env, jobject jthis, jstring jpath, jobject jmessageout,
+(JNIEnv *env, jobject jthis, jobject jpath, jobject jmessageout,
jobject jrevisionStart, jobject jrevisionEnd)
{
JNIEntry(SVNAdmin, verify);
@@ -385,7 +385,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
@@ -406,7 +406,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT jobject JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_lslocks
-(JNIEnv *env, jobject jthis, jstring jpath)
+(JNIEnv *env, jobject jthis, jobject jpath)
{
JNIEntry(SVNAdmin, lslocks);
SVNAdmin *cl = SVNAdmin::getCppObject(jthis);
@@ -416,7 +416,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return NULL;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return NULL;
@@ -425,7 +425,7 @@ Java_org_apache_subversion_javahl_SVNAdm
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNAdmin_rmlocks
-(JNIEnv *env, jobject jthis, jstring jpath, jobjectArray jlocks)
+(JNIEnv *env, jobject jthis, jobject jpath, jobjectArray jlocks)
{
JNIEntry(SVNAdmin, rmlocks);
SVNAdmin *cl = SVNAdmin::getCppObject(jthis);
@@ -435,7 +435,7 @@ Java_org_apache_subversion_javahl_SVNAdm
return;
}
- JNIStringHolder path(jpath);
+ File path(jpath);
if (JNIUtil::isExceptionThrown())
return;
Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNAdmin.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNAdmin.java?rev=953733&r1=953732&r2=953733&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNAdmin.java (original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNAdmin.java Fri Jun 11 15:39:46 2010
@@ -72,7 +72,7 @@ public interface ISVNAdmin {
* @param end end revision
* @throws ClientException throw in case of problem
*/
- public abstract void deltify(String path, Revision start, Revision end)
+ public abstract void deltify(File path, Revision start, Revision end)
throws ClientException;
/**
@@ -87,7 +87,7 @@ public interface ISVNAdmin {
* @throws ClientException throw in case of problem
* @since 1.5
*/
- public abstract void dump(String path, OutputStream dataOut,
+ public abstract void dump(File path, OutputStream dataOut,
OutputStream errorOut, Revision start, Revision end,
boolean incremental, boolean useDeltas)
throws ClientException;
@@ -100,7 +100,7 @@ public interface ISVNAdmin {
* repository
* @throws ClientException throw in case of problem
*/
- public abstract void hotcopy(String path, String targetPath,
+ public abstract void hotcopy(File path, File targetPath,
boolean cleanLogs) throws ClientException;
/**
@@ -109,7 +109,7 @@ public interface ISVNAdmin {
* @param receiver interface to receive the logfile names
* @throws ClientException throw in case of problem
*/
- public abstract void listDBLogs(String path, MessageReceiver receiver)
+ public abstract void listDBLogs(File path, MessageReceiver receiver)
throws ClientException;
/**
@@ -118,7 +118,7 @@ public interface ISVNAdmin {
* @param receiver interface to receive the logfile names
* @throws ClientException throw in case of problem
*/
- public abstract void listUnusedDBLogs(String path, MessageReceiver receiver)
+ public abstract void listUnusedDBLogs(File path, MessageReceiver receiver)
throws ClientException;
/**
@@ -136,7 +136,7 @@ public interface ISVNAdmin {
* @throws ClientException throw in case of problem
* @since 1.5
*/
- public abstract void load(String path, InputStream dataInput,
+ public abstract void load(File path, InputStream dataInput,
OutputStream messageOutput, boolean ignoreUUID, boolean forceUUID,
boolean usePreCommitHook, boolean usePostCommitHook,
String relativePath) throws ClientException;
@@ -147,7 +147,7 @@ public interface ISVNAdmin {
* @param receiver receives one transaction name per call
* @throws ClientException throw in case of problem
*/
- public abstract void lstxns(String path, MessageReceiver receiver)
+ public abstract void lstxns(File path, MessageReceiver receiver)
throws ClientException;
/**
@@ -155,7 +155,7 @@ public interface ISVNAdmin {
* @param path the path to the repository
* @throws ClientException throw in case of problem
*/
- public abstract long recover(String path) throws ClientException;
+ public abstract long recover(File path) throws ClientException;
/**
* remove open transaction in a repository
@@ -163,7 +163,7 @@ public interface ISVNAdmin {
* @param transactions the transactions to be removed
* @throws ClientException throw in case of problem
*/
- public abstract void rmtxns(String path, String[] transactions)
+ public abstract void rmtxns(File path, String[] transactions)
throws ClientException;
/**
@@ -182,7 +182,7 @@ public interface ISVNAdmin {
* @throws SubversionException If a problem occurs.
* @since 1.5.0
*/
- public abstract void setRevProp(String path, Revision rev, String propName,
+ public abstract void setRevProp(File path, Revision rev, String propName,
String propValue, boolean usePreRevPropChangeHook,
boolean usePostRevPropChangeHook) throws SubversionException;
@@ -196,7 +196,7 @@ public interface ISVNAdmin {
* @param end the last revision
* @throws ClientException If an error occurred.
*/
- public abstract void verify(String path, OutputStream messageOut,
+ public abstract void verify(File path, OutputStream messageOut,
Revision start, Revision end) throws ClientException;
/**
@@ -205,7 +205,7 @@ public interface ISVNAdmin {
* @throws ClientException throw in case of problem
* @since 1.2
*/
- public abstract Set<Lock> lslocks(String path) throws ClientException;
+ public abstract Set<Lock> lslocks(File path) throws ClientException;
/**
* remove multiple locks from the repository
@@ -214,7 +214,7 @@ public interface ISVNAdmin {
* @throws ClientException throw in case of problem
* @since 1.2
*/
- public abstract void rmlocks(String path, String[] locks)
+ public abstract void rmlocks(File path, String[] locks)
throws ClientException;
}
Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNAdmin.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNAdmin.java?rev=953733&r1=953732&r2=953733&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNAdmin.java (original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNAdmin.java Fri Jun 11 15:39:46 2010
@@ -110,7 +110,7 @@ public class SVNAdmin implements ISVNAdm
* @param end end revision
* @throws ClientException throw in case of problem
*/
- public native void deltify(String path, Revision start, Revision end)
+ public native void deltify(File path, Revision start, Revision end)
throws ClientException;
/**
@@ -125,7 +125,7 @@ public class SVNAdmin implements ISVNAdm
* @throws ClientException throw in case of problem
* @since 1.5
*/
- public native void dump(String path, OutputStream dataOut,
+ public native void dump(File path, OutputStream dataOut,
OutputStream errorOut, Revision start,
Revision end, boolean incremental,
boolean useDeltas)
@@ -139,7 +139,7 @@ public class SVNAdmin implements ISVNAdm
* repository
* @throws ClientException throw in case of problem
*/
- public native void hotcopy(String path, String targetPath,
+ public native void hotcopy(File path, File targetPath,
boolean cleanLogs) throws ClientException;
/**
@@ -148,7 +148,7 @@ public class SVNAdmin implements ISVNAdm
* @param receiver interface to receive the logfile names
* @throws ClientException throw in case of problem
*/
- public native void listDBLogs(String path, MessageReceiver receiver)
+ public native void listDBLogs(File path, MessageReceiver receiver)
throws ClientException;
/**
@@ -157,7 +157,7 @@ public class SVNAdmin implements ISVNAdm
* @param receiver interface to receive the logfile names
* @throws ClientException throw in case of problem
*/
- public native void listUnusedDBLogs(String path, MessageReceiver receiver)
+ public native void listUnusedDBLogs(File path, MessageReceiver receiver)
throws ClientException;
/**
@@ -187,7 +187,7 @@ public class SVNAdmin implements ISVNAdm
* @throws ClientException throw in case of problem
* @since 1.5
*/
- public native void load(String path, InputStream dataInput,
+ public native void load(File path, InputStream dataInput,
OutputStream messageOutput, boolean ignoreUUID,
boolean forceUUID, boolean usePreCommitHook,
boolean usePostCommitHook, String relativePath)
@@ -199,7 +199,7 @@ public class SVNAdmin implements ISVNAdm
* @param receiver receives one transaction name per call
* @throws ClientException throw in case of problem
*/
- public native void lstxns(String path, MessageReceiver receiver)
+ public native void lstxns(File path, MessageReceiver receiver)
throws ClientException;
/**
@@ -207,7 +207,7 @@ public class SVNAdmin implements ISVNAdm
* @param path the path to the repository
* @throws ClientException throw in case of problem
*/
- public native long recover(String path) throws ClientException;
+ public native long recover(File path) throws ClientException;
/**
* remove open transaction in a repository
@@ -215,7 +215,7 @@ public class SVNAdmin implements ISVNAdm
* @param transactions the transactions to be removed
* @throws ClientException throw in case of problem
*/
- public native void rmtxns(String path, String [] transactions)
+ public native void rmtxns(File path, String[] transactions)
throws ClientException;
/**
@@ -234,7 +234,7 @@ public class SVNAdmin implements ISVNAdm
* @throws SubversionException If a problem occurs.
* @since 1.5.0
*/
- public native void setRevProp(String path, Revision rev,
+ public native void setRevProp(File path, Revision rev,
String propName, String propValue,
boolean usePreRevPropChangeHook,
boolean usePostRevPropChangeHook)
@@ -250,7 +250,7 @@ public class SVNAdmin implements ISVNAdm
* @param end the last revision
* @throws ClientException If an error occurred.
*/
- public native void verify(String path, OutputStream messageOut,
+ public native void verify(File path, OutputStream messageOut,
Revision start, Revision end)
throws ClientException;
@@ -260,7 +260,7 @@ public class SVNAdmin implements ISVNAdm
* @throws ClientException throw in case of problem
* @since 1.2
*/
- public native Set<Lock> lslocks(String path) throws ClientException;
+ public native Set<Lock> lslocks(File path) throws ClientException;
/**
* remove multiple locks from the repository
@@ -269,6 +269,6 @@ public class SVNAdmin implements ISVNAdm
* @throws ClientException throw in case of problem
* @since 1.2
*/
- public native void rmlocks(String path, String [] locks)
+ public native void rmlocks(File path, String[] locks)
throws ClientException;
}
Modified: subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java?rev=953733&r1=953732&r2=953733&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java (original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java Fri Jun 11 15:39:46 2010
@@ -122,7 +122,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.deltify(path,
+ aSVNAdmin.deltify(new File(path),
start == null ? null : start.toApache(),
end == null ? null : end.toApache());
}
@@ -169,7 +169,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.dump(path, new OutputWrapper(dataOut),
+ aSVNAdmin.dump(new File(path), new OutputWrapper(dataOut),
new OutputWrapper(errorOut),
start == null ? null : start.toApache(),
end == null ? null : end.toApache(),
@@ -194,7 +194,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.hotcopy(path, targetPath, cleanLogs);
+ aSVNAdmin.hotcopy(new File(path), new File(targetPath), cleanLogs);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -213,7 +213,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.listDBLogs(path, receiver);
+ aSVNAdmin.listDBLogs(new File(path), receiver);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -232,7 +232,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.listUnusedDBLogs(path, receiver);
+ aSVNAdmin.listUnusedDBLogs(new File(path), receiver);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -292,7 +292,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.load(path, new InputWrapper(dataInput),
+ aSVNAdmin.load(new File(path), new InputWrapper(dataInput),
new OutputWrapper(messageOutput),
ignoreUUID, forceUUID, usePreCommitHook,
usePostCommitHook, relativePath);
@@ -314,7 +314,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.lstxns(path, receiver);
+ aSVNAdmin.lstxns(new File(path), receiver);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -332,7 +332,7 @@ public class SVNAdmin
{
try
{
- return aSVNAdmin.recover(path);
+ return aSVNAdmin.recover(new File(path));
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -351,7 +351,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.rmtxns(path, transactions);
+ aSVNAdmin.rmtxns(new File(path), transactions);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -374,7 +374,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.setRevProp(path,
+ aSVNAdmin.setRevProp(new File(path),
rev == null ? null : rev.toApache(),
"svn:log", message,
!bypassHooks, !bypassHooks);
@@ -408,7 +408,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.setRevProp(path,
+ aSVNAdmin.setRevProp(new File(path),
rev == null ? null : rev.toApache(),
propName, propValue,
usePreRevPropChangeHook,
@@ -436,7 +436,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.verify(path, new OutputWrapper(messageOut),
+ aSVNAdmin.verify(new File(path), new OutputWrapper(messageOut),
start == null ? null : start.toApache(),
end == null ? null : end.toApache());
}
@@ -458,7 +458,8 @@ public class SVNAdmin
try
{
Set<org.apache.subversion.javahl.Lock> aLocks =
- aSVNAdmin.lslocks(path);
+ aSVNAdmin.lslocks(
+ new File(path));
Lock[] locks = new Lock[aLocks.size()];
int i = 0;
@@ -488,7 +489,7 @@ public class SVNAdmin
{
try
{
- aSVNAdmin.rmlocks(path, locks);
+ aSVNAdmin.rmlocks(new File(path), locks);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
Modified: subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNAdminTests.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNAdminTests.java?rev=953733&r1=953732&r2=953733&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNAdminTests.java (original)
+++ subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNAdminTests.java Fri Jun 11 15:39:46 2010
@@ -63,7 +63,7 @@ public class SVNAdminTests extends SVNTe
{
OneTest thisTest = new OneTest(false);
final String MSG = "Initial repository creation";
- admin.setRevProp(thisTest.getRepositoryPath(), Revision.getInstance(0),
+ admin.setRevProp(thisTest.getRepository(), Revision.getInstance(0),
"svn:log", MSG, false, false);
Map<String, byte[]> pdata = client.revProperties(
makeReposUrl(thisTest.getRepository()),
@@ -102,7 +102,7 @@ public class SVNAdminTests extends SVNTe
File dump = new File(testSrcdir, "tests/data/issue2979.dump");
InputStream input = new FileInputStream(dump);
OutputStream loadLog = new IgnoreOutputer();
- admin.load(thisTest.getRepositoryPath(),
+ admin.load(thisTest.getRepository(),
input, loadLog, true, true, false, false, null);
// should have two revs after the load
infoHolder[0] = null;
Modified: subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=953733&r1=953732&r2=953733&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Fri Jun 11 15:39:46 2010
@@ -238,9 +238,8 @@ class SVNTests extends TestCase
NodeKind.none, CommitItemStateFlags.Add);
client.doImport(greekFiles.getAbsolutePath(), makeReposUrl(greekRepos),
null, Depth.infinity, false, false, null);
- admin.dump(greekRepos.getAbsolutePath(),
- new FileOutputStream(greekDump), new IgnoreOutputer(),
- null, null, false, false);
+ admin.dump(greekRepos, new FileOutputStream(greekDump),
+ new IgnoreOutputer(), null, null, false, false);
}
/**
@@ -568,15 +567,6 @@ class SVNTests extends TestCase
}
/**
- * Return the name of the directory of the repository
- * @return the name of repository directory
- */
- public String getRepositoryPath()
- {
- return repository.getAbsolutePath();
- }
-
- /**
* Return the working copy directory
* @return the working copy directory
*/
@@ -661,8 +651,7 @@ class SVNTests extends TestCase
admin.create(repos, true, false, conf, fsType);
if (loadGreek)
{
- admin.load(repos.getAbsolutePath(),
- new FileInputStream(greekDump),
+ admin.load(repos, new FileInputStream(greekDump),
new IgnoreOutputer(), false, false, false, false,
null);
}