You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by st...@apache.org on 2004/07/02 18:24:23 UTC
cvs commit: jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/fs/local LocalFileSystem.java
stefan 2004/07/02 09:24:23
Modified: proposals/jcrri/src/org/apache/slide/jcr/fs
FileSystemResource.java
proposals/jcrri/src/org/apache/slide/jcr/fs/dav
DavFileSystem.java
proposals/jcrri/src/org/apache/slide/jcr/fs/local
LocalFileSystem.java
Log:
jcrri
Revision Changes Path
1.5 +16 -2 jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/fs/FileSystemResource.java
Index: FileSystemResource.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/fs/FileSystemResource.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FileSystemResource.java 22 Jun 2004 18:02:48 -0000 1.4
+++ FileSystemResource.java 2 Jul 2004 16:24:23 -0000 1.5
@@ -186,4 +186,18 @@
public String toString() {
return getPath();
}
+
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof FileSystemResource) {
+ FileSystemResource other = (FileSystemResource) obj;
+ return (path == other.path ||
+ (path != null && path.equals(other.path))) &&
+ (fs == other.fs ||
+ (fs != null && fs.equals(other.fs)));
+ }
+ return false;
+ }
}
1.10 +23 -3 jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/fs/dav/DavFileSystem.java
Index: DavFileSystem.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/fs/dav/DavFileSystem.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DavFileSystem.java 22 Jun 2004 18:02:48 -0000 1.9
+++ DavFileSystem.java 2 Jul 2004 16:24:23 -0000 1.10
@@ -103,7 +103,7 @@
if (relPath != null && relPath.startsWith(SEPARATOR)) {
relPath = relPath.substring(1);
}
- if (relPath == null || relPath.equals("")) {
+ if ("".equals(relPath) || relPath == null) {
// root
return new WebdavResource(urlRoot);
} else {
@@ -114,6 +114,26 @@
private WebdavResource getParentResource(WebdavResource res)
throws IOException, HttpException {
return getResource(res.getHttpURL().getParent().substring(rootPath.length()));
+ }
+
+ //-------------------------------------------< java.lang.Object overrides >
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof DavFileSystem) {
+ DavFileSystem other = (DavFileSystem) obj;
+ return (user == other.user ||
+ (user != null && user.equals(other.user))) &&
+ (pwd == other.pwd ||
+ (pwd != null && pwd.equals(other.pwd))) &&
+ (host == other.host ||
+ (host != null && host.equals(other.host))) &&
+ port == other.port &&
+ (rootPath == other.rootPath ||
+ (rootPath != null && rootPath.equals(other.rootPath)));
+ }
+ return false;
}
//-----------------------------------------------------------< FileSystem >
1.9 +17 -2 jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/fs/local/LocalFileSystem.java
Index: LocalFileSystem.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/fs/local/LocalFileSystem.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- LocalFileSystem.java 22 Jun 2004 18:02:18 -0000 1.8
+++ LocalFileSystem.java 2 Jul 2004 16:24:23 -0000 1.9
@@ -63,6 +63,21 @@
return genericPath.replace(SEPARATOR_CHAR, File.separatorChar);
}
+ //-------------------------------------------< java.lang.Object overrides >
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof LocalFileSystem) {
+ LocalFileSystem other = (LocalFileSystem) obj;
+ return (root == other.root ||
+ (root != null && root.equals(other.root))) &&
+ (rootPath == other.rootPath ||
+ (rootPath != null && rootPath.equals(other.rootPath)));
+ }
+ return false;
+ }
+
//-----------------------------------------------------------< FileSystem >
/**
* @see FileSystem#init()
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org