adammurdoch 2002/10/22 04:51:31
Modified: vfs/src/java/org/apache/commons/vfs/impl VFSClassLoader.java
vfs/src/java/org/apache/commons/vfs/provider
AbstractFileObject.java AbstractFileSystem.java
Resources.properties
vfs/src/java/org/apache/commons/vfs/provider/jar
JarFileSystem.java
vfs/src/java/org/apache/commons/vfs/provider/local
LocalFileSystem.java
vfs/src/java/org/apache/commons/vfs/provider/smb
SmbFileObject.java SmbFileSystem.java
vfs/src/java/org/apache/commons/vfs/provider/url
UrlFileObject.java UrlFileSystem.java
Removed: vfs/src/java/org/apache/commons/vfs Resources.properties
Log:
- Fixed a some typos.
- Removed unused message file.
- Lazy creation of URL object in UrlFileObject.
Revision Changes Path
1.5 +1 -2
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/VFSClassLoader.java
Index: VFSClassLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/VFSClassLoader.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- VFSClassLoader.java 21 Oct 2002 02:52:40 -0000 1.4
+++ VFSClassLoader.java 22 Oct 2002 11:51:30 -0000 1.5
@@ -21,7 +21,6 @@
/**
- *
* A class loader that can load classes and resources from a search path
* VFS FileObjects refering both to folders and JAR files. Any FileObject
* of type {@link FileType#FILE} is asumed to be a JAR and is opened
1.11 +11 -11
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
Index: AbstractFileObject.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AbstractFileObject.java 21 Oct 2002 02:52:40 -0000 1.10
+++ AbstractFileObject.java 22 Oct 2002 11:51:30 -0000 1.11
@@ -23,10 +23,10 @@
import org.apache.commons.vfs.FileName;
import org.apache.commons.vfs.FileObject;
import org.apache.commons.vfs.FileSelector;
+import org.apache.commons.vfs.FileSystem;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileType;
import org.apache.commons.vfs.NameScope;
-import org.apache.commons.vfs.FileSystem;
/**
* A partial file object implementation.
@@ -60,14 +60,6 @@
}
/**
- * Returns the file system this file belongs to.
- */
- public FileSystem getFileSystem()
- {
- return fs;
- }
-
- /**
* Attaches this file object to its file resource. This method is called
* before any of the doBlah() or onBlah() methods. Sub-classes can use
* this method to perform lazy initialisation.
@@ -188,7 +180,7 @@
* The default implementation just returns null so filesystems must
* override it to use it.
*/
- protected Object doGetAttribute( String atttrName )
+ protected Object doGetAttribute( String attrName )
throws FileSystemException
{
return null;
@@ -285,6 +277,14 @@
}
/**
+ * Returns the file system this file belongs to.
+ */
+ public FileSystem getFileSystem()
+ {
+ return fs;
+ }
+
+ /**
* Returns a URL representation of the file.
*/
public URL getURL() throws MalformedURLException
@@ -957,7 +957,7 @@
fileInfo.setFile( child );
traverse( fileInfo, selector, depthwise, selected );
}
-
+
fileInfo.setFile( file );
fileInfo.setDepth( curDepth );
}
1.8 +2 -2
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java
Index: AbstractFileSystem.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AbstractFileSystem.java 21 Oct 2002 01:40:38 -0000 1.7
+++ AbstractFileSystem.java 22 Oct 2002 11:51:30 -0000 1.8
@@ -24,9 +24,9 @@
extends AbstractVfsComponent
implements FileSystem
{
+ private final FileName rootName;
private FileObject parentLayer;
private FileObject root;
- private final FileName rootName;
/** Map from FileName to FileObject. */
private final Map files = new HashMap();
@@ -68,7 +68,7 @@
}
/**
- * Retrives the attribute with the specified name. The default
+ * Retrieves the attribute with the specified name. The default
* implementation simply throws an exception.
*/
public Object getAttribute( String attrName ) throws FileSystemException
1.4 +1 -1
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/Resources.properties
Index: Resources.properties
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/Resources.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Resources.properties 22 Aug 2002 08:00:38 -0000 1.3
+++ Resources.properties 22 Oct 2002 11:51:30 -0000 1.4
@@ -21,7 +21,7 @@
write.error=Could not write to "{0}".
copy-file.error=Could not copy "{0}" to "{1}".
copy-read-only.error=Could not copy {0} "{1}" to "{2}" because the destination file
is read-only.
-copy-missing-file.error=Could not copy "{0}" because is does not exist.
+copy-missing-file.error=Could not copy "{0}" because it does not exist.
# DefaultFileContent
get-size-folder.error=Could not determine the size of "{0}" because it is a folder.
1.3 +2 -2
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/jar/JarFileSystem.java
Index: JarFileSystem.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/jar/JarFileSystem.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JarFileSystem.java 21 Oct 2002 01:40:38 -0000 1.2
+++ JarFileSystem.java 22 Oct 2002 11:51:30 -0000 1.3
@@ -28,7 +28,7 @@
* @author <a href="mailto:brian@;mmmanager.org">Brian Olsen</a>
* @version $Revision$ $Date$
*/
-public class JarFileSystem
+class JarFileSystem
extends ZipFileSystem
{
private Attributes attributes;
1.7 +2 -1
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/local/LocalFileSystem.java
Index: LocalFileSystem.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/local/LocalFileSystem.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- LocalFileSystem.java 21 Oct 2002 02:52:40 -0000 1.6
+++ LocalFileSystem.java 22 Oct 2002 11:51:30 -0000 1.7
@@ -35,7 +35,8 @@
/**
* Creates a file object.
*/
- protected FileObject createFile( final FileName name ) throws
FileSystemException
+ protected FileObject createFile( final FileName name )
+ throws FileSystemException
{
// Create the file
final String fileName = rootFile + name.getPath();
1.5 +2 -3
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/smb/SmbFileObject.java
Index: SmbFileObject.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/smb/SmbFileObject.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SmbFileObject.java 21 Oct 2002 01:40:38 -0000 1.4
+++ SmbFileObject.java 22 Oct 2002 11:51:31 -0000 1.5
@@ -31,12 +31,11 @@
private final String fileName;
private SmbFile file;
- protected SmbFileObject( final String fileName,
- final FileName name,
+ protected SmbFileObject( final FileName name,
final SmbFileSystem fileSystem )
{
super( name, fileSystem );
- this.fileName = fileName;
+ this.fileName = name.getURI();
}
/**
1.7 +1 -2
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/smb/SmbFileSystem.java
Index: SmbFileSystem.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/smb/SmbFileSystem.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SmbFileSystem.java 21 Oct 2002 02:52:40 -0000 1.6
+++ SmbFileSystem.java 22 Oct 2002 11:51:31 -0000 1.7
@@ -33,7 +33,6 @@
*/
protected FileObject createFile( final FileName name ) throws
FileSystemException
{
- final String fileName = name.getURI();
- return new SmbFileObject( fileName, name, this );
+ return new SmbFileObject( name, this );
}
}
1.2 +16 -5
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/url/UrlFileObject.java
Index: UrlFileObject.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/url/UrlFileObject.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UrlFileObject.java 21 Aug 2002 01:39:47 -0000 1.1
+++ UrlFileObject.java 22 Oct 2002 11:51:31 -0000 1.2
@@ -27,12 +27,23 @@
{
private URL url;
- public UrlFileObject( UrlFileSystem fs,
- FileName fileName,
- URL url )
+ public UrlFileObject( final UrlFileSystem fs,
+ final FileName fileName )
{
super( fileName, fs );
- this.url = url;
+ }
+
+ /**
+ * Attaches this file object to its file resource. This method is called
+ * before any of the doBlah() or onBlah() methods. Sub-classes can use
+ * this method to perform lazy initialisation.
+ */
+ protected void doAttach() throws Exception
+ {
+ if ( url == null )
+ {
+ url = new URL( getName().getURI() );
+ }
}
/**
1.7 +3 -13
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/url/UrlFileSystem.java
Index: UrlFileSystem.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/url/UrlFileSystem.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- UrlFileSystem.java 22 Aug 2002 02:42:46 -0000 1.6
+++ UrlFileSystem.java 22 Oct 2002 11:51:31 -0000 1.7
@@ -7,13 +7,11 @@
*/
package org.apache.commons.vfs.provider.url;
-import java.net.MalformedURLException;
-import java.net.URL;
import org.apache.commons.vfs.FileName;
import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystem;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.provider.AbstractFileSystem;
-import org.apache.commons.vfs.FileSystem;
/**
* A File system backed by Java's URL API.
@@ -35,14 +33,6 @@
*/
protected FileObject createFile( final FileName name ) throws
FileSystemException
{
- try
- {
- final URL url = new URL( name.getURI() );
- return new UrlFileObject( this, name, url );
- }
- catch ( MalformedURLException e )
- {
- throw new FileSystemException( e );
- }
+ return new UrlFileObject( this, name );
}
}
--
To unsubscribe, e-mail: <mailto:commons-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>