jicarilla-sandbox/platform/components/http/impl/src/java/org/jicarilla/io FilesystemImpl.java,1.3,1.4
| Newsgroups | gmane.comp.java.jicarilla.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/impl/src/java/org/jicarilla/io
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2537/components/http/impl/src/java/org/jicarilla/io
Modified Files:
FilesystemImpl.java
Log Message:
Ran some code analysis tools on the code and changed approximately 200 small things based on that. Nothing shocking (I hope!)
Index: FilesystemImpl.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/impl/src/java/org/jicarilla/io/FilesystemImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- FilesystemImpl.java 11 Jan 2004 12:34:23 -0000 1.3
+++ FilesystemImpl.java 26 Feb 2004 16:51:55 -0000 1.4
@@ -53,10 +53,10 @@
// ----------------------------------------------------------------------
// Constructor
// ----------------------------------------------------------------------
- public FilesystemImpl( String rootDirectory )
+ public FilesystemImpl( final String rootDirectory )
{
Assert.assertNotNull( rootDirectory );
- File root = new File( rootDirectory );
+ final File root = new File( rootDirectory );
setRootDirectory( root );
m_openFiles = new WeakHashMap();
@@ -70,7 +70,7 @@
return m_rootDirectory;
}
- protected synchronized void setRootDirectory( File root )
+ protected synchronized void setRootDirectory( final File root )
{
Assert.assertNotNull( root );
Assert.assertTrue( root.exists() );
@@ -85,7 +85,7 @@
return m_openFiles;
}
- protected synchronized void setOpenFiles( Map openFiles )
+ protected synchronized void setOpenFiles( final Map openFiles )
{
m_openFiles = openFiles;
}
@@ -93,36 +93,36 @@
// ----------------------------------------------------------------------
// Interface: Filesystem
// ----------------------------------------------------------------------
- public synchronized ReadableByteChannel getFile( String relativePath )
+ public synchronized ReadableByteChannel getFile( final String relativePath )
throws FileNotFoundException
{
- String path;
+ final String path;
if( relativePath.charAt(0) != File.separatorChar )
path = m_rootDirectory.getAbsolutePath() + File.separator + relativePath;
else
path = m_rootDirectory.getAbsolutePath() + relativePath;
- File file = new File( path );
+ final File file = new File( path );
if( !file.exists() )
throw new FileNotFoundException(path);
Assert.assertTrue( file.canRead() );
Assert.assertFalse( file.isDirectory() );
- FileInputStream fis = new FileInputStream( file );
- FileChannel fc = fis.getChannel();
+ final FileInputStream fis = new FileInputStream( file );
+ final FileChannel fc = fis.getChannel();
getOpenFiles().put( fc, fis );
return fc;
}
- public synchronized void returnFile( ReadableByteChannel channel )
+ public synchronized void returnFile( final ReadableByteChannel channel )
{
- if(! (channel instanceof FileChannel) || channel == null )
+ if(! (channel instanceof FileChannel) )
return;
- FileChannel fc = ((FileChannel)channel);
+ final FileChannel fc = (FileChannel)channel;
if( getOpenFiles().containsKey( fc ) )
{
- FileInputStream fs = (FileInputStream)getOpenFiles().remove( fc );
+ final FileInputStream fs = (FileInputStream)getOpenFiles().remove( fc );
try
{
fs.close();
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click