From: <cr...@us...> - 2009-05-23 03:54:16
|
Revision: 5502 http://jnode.svn.sourceforge.net/jnode/?rev=5502&view=rev Author: crawley Date: 2009-05-23 03:54:04 +0000 (Sat, 23 May 2009) Log Message: ----------- Fixing lots of compiler warnings. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/FileSystemException.java trunk/fs/src/fs/org/jnode/fs/FileSystemFullException.java trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java trunk/fs/src/fs/org/jnode/fs/ext2/cache/BlockCache.java trunk/fs/src/fs/org/jnode/fs/ext2/cache/CacheEvent.java trunk/fs/src/fs/org/jnode/fs/ext2/cache/INodeCache.java trunk/fs/src/fs/org/jnode/fs/ext2/exception/UnallocatedBlockException.java trunk/fs/src/fs/org/jnode/fs/fat/FatObject.java trunk/fs/src/fs/org/jnode/fs/fat/LfnEntry.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java trunk/fs/src/fs/org/jnode/fs/hfsplus/extent/Extent.java trunk/fs/src/fs/org/jnode/fs/initrd/InitRamdisk.java trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Directory.java trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java trunk/fs/src/fs/org/jnode/fs/jarfs/FSTreeBuilder.java trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSDirectory.java trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSEntry.java trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSFile.java trunk/fs/src/fs/org/jnode/fs/jfat/BootSector.java trunk/fs/src/fs/org/jnode/fs/jfat/CodePageDecoder.java trunk/fs/src/fs/org/jnode/fs/jfat/CodePageEncoder.java trunk/fs/src/fs/org/jnode/fs/jfat/FatCache.java trunk/fs/src/fs/org/jnode/fs/jfat/FatChain.java trunk/fs/src/fs/org/jnode/fs/jfat/FatFormatter.java trunk/fs/src/fs/org/jnode/fs/jfat/FatLongDirEntry.java trunk/fs/src/fs/org/jnode/fs/jfat/FatName.java trunk/fs/src/fs/org/jnode/fs/jfat/FatShortDirEntry.java trunk/fs/src/fs/org/jnode/fs/jifs/JIFSDirectory.java trunk/fs/src/fs/org/jnode/fs/jifs/JIFSFile.java trunk/fs/src/fs/org/jnode/fs/jifs/def/JIFSPlugin.java trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2AccessRights.java trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Directory.java trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Entry.java trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2File.java trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Object.java trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSDirectory.java trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSEntry.java trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSFile.java trunk/fs/src/fs/org/jnode/fs/ramfs/RAMDirectory.java trunk/fs/src/fs/org/jnode/fs/ramfs/RAMFile.java trunk/fs/src/fs/org/jnode/fs/service/def/FileHandleManager.java trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemTypeManager.java trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSDirectory.java trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSEntry.java trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSObject.java trunk/fs/src/fs/org/jnode/fs/spi/FSEntryTable.java trunk/fs/src/fs/org/jnode/fs/spi/UnixFSAccessRights.java trunk/fs/src/fs/org/jnode/partitions/PartitionTableEntry.java trunk/fs/src/fs/org/jnode/partitions/PartitionTableException.java trunk/fs/src/fs/org/jnode/partitions/PartitionTableType.java trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableEntry.java trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableType.java trunk/fs/src/fs/org/jnode/partitions/ibm/MasterBootRecord.java Modified: trunk/fs/src/fs/org/jnode/fs/FileSystemException.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/FileSystemException.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/FileSystemException.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -25,6 +25,8 @@ */ public class FileSystemException extends Exception { + private static final long serialVersionUID = 1L; + /** * */ Modified: trunk/fs/src/fs/org/jnode/fs/FileSystemFullException.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/FileSystemFullException.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/FileSystemFullException.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -24,6 +24,8 @@ public class FileSystemFullException extends IOException { + private static final long serialVersionUID = 1L; + public FileSystemFullException(String message) { super(message); } Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -47,8 +47,7 @@ private final Logger log = Logger.getLogger(getClass()); /** - * @param entry - * the Ext2Entry representing this directory + * @param entry the Ext2Entry representing this directory */ public Ext2Directory(Ext2Entry entry) throws IOException { super((Ext2FileSystem) entry.getFileSystem()); @@ -427,7 +426,7 @@ entries.add(entry); } - FSEntryTable table = new FSEntryTable((AbstractFileSystem) getFileSystem(), entries); + FSEntryTable table = new FSEntryTable((AbstractFileSystem<?>) getFileSystem(), entries); return table; } Modified: trunk/fs/src/fs/org/jnode/fs/ext2/cache/BlockCache.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/cache/BlockCache.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ext2/cache/BlockCache.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -31,6 +31,8 @@ * @author Andras Nagy */ public final class BlockCache extends LinkedHashMap<Object, Block> { + private static final long serialVersionUID = 1L; + // at most MAX_SIZE blocks fit in the cache static final int MAX_SIZE = 10; Modified: trunk/fs/src/fs/org/jnode/fs/ext2/cache/CacheEvent.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/cache/CacheEvent.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ext2/cache/CacheEvent.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -29,6 +29,7 @@ * @author Andras Nagy */ public class CacheEvent extends EventObject { + private static final long serialVersionUID = 1L; public static final int REMOVED = 0; private int eventType; Modified: trunk/fs/src/fs/org/jnode/fs/ext2/cache/INodeCache.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/cache/INodeCache.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ext2/cache/INodeCache.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -28,6 +28,8 @@ * @author Andras Nagy */ public class INodeCache extends Hashtable<Object, INode> { + private static final long serialVersionUID = 1L; + public INodeCache(int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); } Modified: trunk/fs/src/fs/org/jnode/fs/ext2/exception/UnallocatedBlockException.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/exception/UnallocatedBlockException.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ext2/exception/UnallocatedBlockException.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -27,6 +27,9 @@ * */ public class UnallocatedBlockException extends IOException { + + private static final long serialVersionUID = 1L; + public UnallocatedBlockException(String s) { super(s); } Modified: trunk/fs/src/fs/org/jnode/fs/fat/FatObject.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/fat/FatObject.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/fat/FatObject.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -30,6 +30,7 @@ /** The filesystem I'm a part of */ private final FatFileSystem fs; + /** Is this object still valid? */ private boolean valid; @@ -59,7 +60,7 @@ /** * Gets the filesystem I'm a part of. */ - public final FileSystem getFileSystem() { + public final FileSystem<?> getFileSystem() { return fs; } Modified: trunk/fs/src/fs/org/jnode/fs/fat/LfnEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/fat/LfnEntry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/fat/LfnEntry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -169,7 +169,7 @@ return realEntry.isValid(); } - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { return realEntry.getFileSystem(); } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -23,7 +23,6 @@ import java.io.IOException; import org.apache.log4j.Logger; -import org.jnode.driver.ApiNotFoundException; import org.jnode.driver.Device; import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; @@ -170,7 +169,10 @@ } private void writeAllocationFile(int blockUsed) { + @SuppressWarnings("unused") int bytes = blockUsed >> 3; + @SuppressWarnings("unused") int bits = blockUsed & 0x0007; + // FIXME ... this should be completed } } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/extent/Extent.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/extent/Extent.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/extent/Extent.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -28,7 +28,9 @@ public class Extent { private final Logger log = Logger.getLogger(getClass()); + @SuppressWarnings("unused") private NodeDescriptor btnd; + @SuppressWarnings("unused") private BTHeaderRecord bthr; public Extent(HFSPlusParams params) { @@ -37,12 +39,11 @@ // int totalNodes = params.getExtentClumpSize() / params.getExtentNodeSize(); int freeNodes = totalNodes - 1; - bthr = - new BTHeaderRecord(0, 0, 0, 0, 0, params.getExtentNodeSize(), - ExtentKey.MAXIMUM_KEY_LENGTH, totalNodes, freeNodes, params - .getExtentClumpSize(), BTHeaderRecord.BT_TYPE_HFS, - BTHeaderRecord.KEY_COMPARE_TYPE_CASE_FOLDING, - BTHeaderRecord.BT_BIG_KEYS_MASK); + bthr = new BTHeaderRecord(0, 0, 0, 0, 0, params.getExtentNodeSize(), + ExtentKey.MAXIMUM_KEY_LENGTH, totalNodes, freeNodes, + params.getExtentClumpSize(), BTHeaderRecord.BT_TYPE_HFS, + BTHeaderRecord.KEY_COMPARE_TYPE_CASE_FOLDING, + BTHeaderRecord.BT_BIG_KEYS_MASK); } } Modified: trunk/fs/src/fs/org/jnode/fs/initrd/InitRamdisk.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/initrd/InitRamdisk.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/initrd/InitRamdisk.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -72,7 +72,7 @@ log.info("Format initrd ramdisk"); final FatFileSystemFormatter formatter = new FatFileSystemFormatter(FatType.FAT16); - final FileSystem fs = formatter.format(dev); + final FileSystem<?> fs = formatter.format(dev); try { fs.getRootEntry().getDirectory().addDirectory("tmp"); } catch (IOException ex) { Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Directory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Directory.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Directory.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -120,7 +120,7 @@ /** * @see org.jnode.fs.FSObject#getFileSystem() */ - public final FileSystem getFileSystem() { + public final FileSystem<?> getFileSystem() { return entry.getFileSystem(); } Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -122,7 +122,7 @@ /** * @see org.jnode.fs.FSObject#getFileSystem() */ - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { return fs; } Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -92,7 +92,7 @@ /** * @see org.jnode.fs.FSObject#getFileSystem() */ - public final FileSystem getFileSystem() { + public final FileSystem<?> getFileSystem() { return entry.getFileSystem(); } } Modified: trunk/fs/src/fs/org/jnode/fs/jarfs/FSTreeBuilder.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jarfs/FSTreeBuilder.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jarfs/FSTreeBuilder.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -31,7 +31,6 @@ public class FSTreeBuilder { public static final char separator = '/'; - @SuppressWarnings("unchecked") public static JarFSEntry build(JarFileSystem fs, JarFile jarFile, JarFSCache cache) { JarFSEntry root = new JarFSEntry(fs, null, null, jarFile.getName()); Map<String, JarFSEntry> nameToJarFSEntry = new HashMap<String, JarFSEntry>(); Modified: trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSDirectory.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSDirectory.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -92,7 +92,7 @@ /** * @see org.jnode.fs.FSObject#getFileSystem() */ - public final FileSystem getFileSystem() { + public final FileSystem<?> getFileSystem() { return entry.getFileSystem(); } Modified: trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSEntry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSEntry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -110,7 +110,7 @@ return true; } - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { return fs; } } Modified: trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSFile.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jarfs/JarFSFile.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -98,7 +98,7 @@ /** * @see org.jnode.fs.FSObject#getFileSystem() */ - public final FileSystem getFileSystem() { + public final FileSystem<?> getFileSystem() { return entry.getFileSystem(); } } Modified: trunk/fs/src/fs/org/jnode/fs/jfat/BootSector.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/BootSector.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jfat/BootSector.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -34,6 +34,7 @@ * @author Tango */ public class BootSector { + @SuppressWarnings("unused") private static final Logger log = Logger.getLogger(BootSector.class); private static final int IFAT12 = 12; @@ -201,6 +202,7 @@ } } + @SuppressWarnings("unused") private void encode() { setBytes(0, 3, BS_jmpBoot); setString(3, 8, BS_OEMName); Modified: trunk/fs/src/fs/org/jnode/fs/jfat/CodePageDecoder.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/CodePageDecoder.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jfat/CodePageDecoder.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -30,11 +30,9 @@ * @author gvt */ public class CodePageDecoder { - private final Charset cs; private final CharsetDecoder decoder; protected CodePageDecoder(Charset cs) { - this.cs = cs; this.decoder = cs.newDecoder(); reset(); } Modified: trunk/fs/src/fs/org/jnode/fs/jfat/CodePageEncoder.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/CodePageEncoder.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jfat/CodePageEncoder.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -32,12 +32,10 @@ * @author gvt */ public class CodePageEncoder { - private final Charset cs; private final CharsetEncoder encoder; private boolean lossy; protected CodePageEncoder(Charset cs) { - this.cs = cs; this.encoder = cs.newEncoder(); reset(); } Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatCache.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatCache.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatCache.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -190,6 +190,7 @@ } private class CacheMap extends LinkedHashMap<CacheKey, CacheElement> { + private static final long serialVersionUID = 1L; private final int cacheSize; private final CacheKey key = new CacheKey(); private final Stack<CacheElement> free = new Stack<CacheElement>(); Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatChain.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatChain.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatChain.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -606,6 +606,7 @@ return (size - offset); } + @SuppressWarnings("unused") private final long getPosition() { return position; } @@ -727,6 +728,7 @@ * ... peraphs an UnsupportedOperationException would be better here ... * but who knows? ;-) */ + @SuppressWarnings("unused") private int previous() throws IOException { if (!hasPrevious()) throw new NoSuchElementException(); @@ -745,6 +747,7 @@ return index; } + @SuppressWarnings("unused") private int previousIndex() { return (index - 1); } Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatFormatter.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatFormatter.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatFormatter.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -340,6 +340,7 @@ * @param api * @throws IOException */ + @SuppressWarnings("unused") private void setQuickDiskFree(int TotalSectors, BlockDeviceAPI api) throws IOException { // TODO:For Total Disk Formatting } Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatLongDirEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatLongDirEntry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatLongDirEntry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -233,6 +233,7 @@ decodeOthers(); } + @SuppressWarnings("unused") private void encode() throws IOException { encodeOrdinal(); encodeComponent(); Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatName.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatName.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatName.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -47,6 +47,7 @@ '"', '*', '+', ',', '/', ':', ';', '<', '=', '>', '?', '[', '\\', ']', '|'}; private final FatDirectory parent; + @SuppressWarnings("unused") private final String name; private final CodePageEncoder encoder; private final CodePageDecoder decoder; Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatShortDirEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatShortDirEntry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatShortDirEntry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -290,6 +290,7 @@ decodeLength(); } + @SuppressWarnings("unused") private void encode() { encodeNameCase(); encodeAttr(); Modified: trunk/fs/src/fs/org/jnode/fs/jifs/JIFSDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jifs/JIFSDirectory.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jifs/JIFSDirectory.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -100,7 +100,7 @@ return false; } - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { // TODO return null; } Modified: trunk/fs/src/fs/org/jnode/fs/jifs/JIFSFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jifs/JIFSFile.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jifs/JIFSFile.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -113,7 +113,7 @@ return isvalid; } - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { // TODO return null; } Modified: trunk/fs/src/fs/org/jnode/fs/jifs/def/JIFSPlugin.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jifs/def/JIFSPlugin.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/jifs/def/JIFSPlugin.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -52,9 +52,11 @@ * My logger */ private static final Logger log = Logger.getLogger(JIFSPlugin.class); + /** * Manager of Extensions */ + @SuppressWarnings("unused") private JIFSExtension jifsExtension; public JIFSPlugin(PluginDescriptor descriptor) { Modified: trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2AccessRights.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2AccessRights.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2AccessRights.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -27,6 +27,7 @@ public class NFS2AccessRights extends NFS2Object implements FSAccessRights { + @SuppressWarnings("unused") private NFS2Entry entry; public NFS2AccessRights(NFS2FileSystem fileSystem, NFS2Entry entry) { Modified: trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Directory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Directory.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Directory.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -112,6 +112,7 @@ public Iterator<? extends NFS2Entry> iterator() throws IOException { final NFS2Client nfsClient = getNFS2Client(); + @SuppressWarnings("unused") FileAttribute fileAttribute; try { fileAttribute = Modified: trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Entry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Entry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Entry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -48,6 +48,7 @@ private String name; + @SuppressWarnings("unused") private NFS2AccessRights accessRights; Modified: trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2File.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2File.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2File.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -24,7 +24,6 @@ import java.nio.ByteBuffer; import org.jnode.fs.FSFile; -import org.jnode.net.nfs.nfs2.FileAttribute; import org.jnode.net.nfs.nfs2.NFS2Client; import org.jnode.net.nfs.nfs2.NFS2Exception; import org.jnode.net.nfs.nfs2.ReadFileResult; @@ -125,8 +124,7 @@ while (src.remaining() > 0) { count = Math.min(NFS2Client.MAX_DATA, src.remaining()); src.get(data, 0, count); - FileAttribute fileAttribute = - client.writeFile(entry.getFileHandle(), (int) fileOffset, data, 0, count); + client.writeFile(entry.getFileHandle(), (int) fileOffset, data, 0, count); fileOffset += count; } } catch (NFS2Exception e) { Modified: trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Object.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Object.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Object.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -32,7 +32,7 @@ this.fileSystem = fileSystem; } - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { return fileSystem; } Modified: trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSDirectory.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSDirectory.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -103,7 +103,7 @@ /** * */ - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { return fs; } Modified: trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSEntry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSEntry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -171,7 +171,7 @@ /** * @see org.jnode.fs.FSObject#getFileSystem() */ - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { return fs; } Modified: trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSFile.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSFile.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -99,7 +99,7 @@ * * @see org.jnode.fs.FSObject#getFileSystem() */ - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { // TODO Auto-generated method stub return null; } Modified: trunk/fs/src/fs/org/jnode/fs/ramfs/RAMDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ramfs/RAMDirectory.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ramfs/RAMDirectory.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -192,7 +192,7 @@ * * @see org.jnode.fs.FSObject#getFileSystem() */ - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { return filesystem; } Modified: trunk/fs/src/fs/org/jnode/fs/ramfs/RAMFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ramfs/RAMFile.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/ramfs/RAMFile.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -222,7 +222,7 @@ * * @see org.jnode.fs.FSObject#getFileSystem() */ - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { return fileSystem; } Modified: trunk/fs/src/fs/org/jnode/fs/service/def/FileHandleManager.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/service/def/FileHandleManager.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/service/def/FileHandleManager.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -98,6 +98,7 @@ class FileData { /** My logger */ + @SuppressWarnings("unused") private final Logger fdLog = Logger.getLogger(getClass()); /** The actual file */ private final FSFile file; Modified: trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -49,6 +49,7 @@ private static final Logger log = Logger.getLogger(FileSystemAPIImpl.class); /** My filesystem manager */ + @SuppressWarnings("unused") private final FileSystemManager fsm; /** The path to entry cache */ Modified: trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemTypeManager.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemTypeManager.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemTypeManager.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -80,6 +80,10 @@ * @return a FileSystemType implementation or null if it doesn't exists. */ public synchronized <T extends FileSystemType<?>> T getSystemType(Class<T> name) { + // FIXME ... there is a real type problem here. There is nothing to stop the + // method returning a FileSystemType for the wrong kind of file system. We + // should either figure out how to make this typesafe or change the signature + // to return FileSystemType<?> return (T) types.get(name); } Modified: trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSDirectory.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSDirectory.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -50,7 +50,7 @@ * * @param fs */ - public AbstractFSDirectory(AbstractFileSystem fs) { + public AbstractFSDirectory(AbstractFileSystem<?> fs) { this(fs, false); } @@ -60,7 +60,7 @@ * @param fs * @param root true if it's a root directory */ - public AbstractFSDirectory(AbstractFileSystem fs, boolean root) { + public AbstractFSDirectory(AbstractFileSystem<?> fs, boolean root) { super(fs); this.isRoot = root; } Modified: trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSEntry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSEntry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -83,7 +83,7 @@ * * @param fs */ - public AbstractFSEntry(AbstractFileSystem fs) { + public AbstractFSEntry(AbstractFileSystem<?> fs) { // parent and table are null for a root this(fs, null, null, "/", ROOT_ENTRY); } @@ -97,7 +97,7 @@ * @param name * @param type */ - public AbstractFSEntry(AbstractFileSystem fs, FSEntryTable table, FSDirectory parent, + public AbstractFSEntry(AbstractFileSystem<?> fs, FSEntryTable table, FSDirectory parent, String name, int type) { super(fs); if ((type <= FIRST_ENTRY) || (type >= LAST_ENTRY)) Modified: trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -38,7 +38,7 @@ * * @param fs */ - public AbstractFSFile(AbstractFileSystem fs) { + public AbstractFSFile(AbstractFileSystem<?> fs) { super(fs); } Modified: trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSObject.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSObject.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSObject.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -33,7 +33,7 @@ */ public abstract class AbstractFSObject implements FSObject { - private AbstractFileSystem fileSystem; + private AbstractFileSystem<?> fileSystem; private boolean valid; private boolean dirty; @@ -47,7 +47,7 @@ * * @param fs */ - public AbstractFSObject(AbstractFileSystem fs) { + public AbstractFSObject(AbstractFileSystem<?> fs) { this.fileSystem = fs; this.valid = true; this.dirty = false; @@ -111,7 +111,7 @@ * * @return the FileSystem this object belongs to */ - public final FileSystem getFileSystem() { + public final FileSystem<?> getFileSystem() { return fileSystem; } Modified: trunk/fs/src/fs/org/jnode/fs/spi/FSEntryTable.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/spi/FSEntryTable.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/spi/FSEntryTable.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -33,7 +33,7 @@ /** * A table containing all the entries of a directory. This class and its childs - * have the responsability to identify an entry by its name (case sensitivity, + * have the responsibility to identify an entry by its name (case sensitivity, * long file name, ...). The class can limit the number of entries (for root * directories ...) if necessary. * @@ -63,7 +63,7 @@ private List<String> entryNames; /** - * Private constuctor for EMPTY_TABLE + * Private constructor for EMPTY_TABLE */ private FSEntryTable() { entries = Collections.emptyMap(); @@ -76,7 +76,7 @@ * @param fs * @param entryList */ - public FSEntryTable(AbstractFileSystem fs, List<FSEntry> entryList) { + public FSEntryTable(AbstractFileSystem<?> fs, List<FSEntry> entryList) { super(fs); // As a value may be null (a free entry) // we must use HashMap and not Hashtable @@ -347,7 +347,7 @@ * * @return a list of all FSEntries */ - public List/* <FSEntry> */toList() { + public List<?>/* <FSEntry> */toList() { // false means not compacted (ie can contain some null entries) return toList(false); } Modified: trunk/fs/src/fs/org/jnode/fs/spi/UnixFSAccessRights.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/spi/UnixFSAccessRights.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/fs/spi/UnixFSAccessRights.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -36,7 +36,7 @@ * */ public class UnixFSAccessRights implements FSAccessRights { - private final FileSystem filesystem; + private final FileSystem<?> filesystem; private Principal owner; private Group group; @@ -45,7 +45,7 @@ private final Rights groupRights = new Rights(); private final Rights worldRights = new Rights(); - public UnixFSAccessRights(FileSystem filesystem) { + public UnixFSAccessRights(FileSystem<?> filesystem) { if (filesystem == null) { throw new NullPointerException("filesystem can't be null"); } @@ -131,7 +131,7 @@ return true; } - public FileSystem getFileSystem() { + public FileSystem<?> getFileSystem() { return filesystem; } Modified: trunk/fs/src/fs/org/jnode/partitions/PartitionTableEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/PartitionTableEntry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/partitions/PartitionTableEntry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -42,6 +42,6 @@ * * @return null of {{@link #hasChildPartitionTable()} is false. */ - public PartitionTable getChildPartitionTable(); + public PartitionTable<?> getChildPartitionTable(); } Modified: trunk/fs/src/fs/org/jnode/partitions/PartitionTableException.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/PartitionTableException.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/partitions/PartitionTableException.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -25,6 +25,8 @@ */ public class PartitionTableException extends Exception { + private static final long serialVersionUID = 1L; + public PartitionTableException() { super(); } Modified: trunk/fs/src/fs/org/jnode/partitions/PartitionTableType.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/PartitionTableType.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/partitions/PartitionTableType.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -48,6 +48,6 @@ * @param device * @param firstSector */ - public PartitionTable create(byte[] firstSector, Device device) throws PartitionTableException; + public PartitionTable<?> create(byte[] firstSector, Device device) throws PartitionTableException; } Modified: trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableEntry.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableEntry.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -32,6 +32,7 @@ private final byte[] bs; private final int ofs; + @SuppressWarnings("unused") private final IBMPartitionTable parent; public IBMPartitionTableEntry(IBMPartitionTable parent, byte[] bs, int partNr) { Modified: trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableType.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableType.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableType.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -33,7 +33,7 @@ */ public class IBMPartitionTableType implements PartitionTableType { - public PartitionTable create(byte[] firstSector, Device device) throws PartitionTableException { + public PartitionTable<?> create(byte[] firstSector, Device device) throws PartitionTableException { return new IBMPartitionTable(this, firstSector, device); } Modified: trunk/fs/src/fs/org/jnode/partitions/ibm/MasterBootRecord.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/ibm/MasterBootRecord.java 2009-05-22 14:57:14 UTC (rev 5501) +++ trunk/fs/src/fs/org/jnode/partitions/ibm/MasterBootRecord.java 2009-05-23 03:54:04 UTC (rev 5502) @@ -31,7 +31,9 @@ private static final int PARTITION_TABLE_END_OFFSET = PARTITION_TABLE_OFFSET + 64; private final ByteBuffer mbr; + @SuppressWarnings("unused") private boolean dirty; + @SuppressWarnings("unused") private final IBMPartitionTableEntry[] partitions; public MasterBootRecord() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2012-08-10 06:53:39
|
Revision: 5915 http://jnode.svn.sourceforge.net/jnode/?rev=5915&view=rev Author: galatnm Date: 2012-08-10 06:53:31 +0000 (Fri, 10 Aug 2012) Log Message: ----------- FS improvments Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystemType.java trunk/fs/src/fs/org/jnode/fs/fat/Fat.java trunk/fs/src/fs/org/jnode/fs/fat/FatDirEntry.java trunk/fs/src/fs/org/jnode/fs/fat/FatFileSystemType.java trunk/fs/src/fs/org/jnode/fs/fat/LfnEntry.java trunk/fs/src/fs/org/jnode/fs/ftpfs/FTPFSEntry.java trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java trunk/fs/src/fs/org/jnode/fs/jfat/FatEntry.java trunk/fs/src/fs/org/jnode/fs/jfat/FatFileSystemType.java trunk/fs/src/fs/org/jnode/fs/ntfs/IndexAllocationAttribute.java trunk/fs/src/fs/org/jnode/fs/ntfs/IndexEntry.java trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSEntry.java trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableEntry.java trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableType.java Added Paths: ----------- trunk/fs/src/fs/org/jnode/fs/FSEntryCreated.java trunk/fs/src/fs/org/jnode/fs/FSEntryLastAccessed.java trunk/fs/src/fs/org/jnode/fs/FSEntryLastChanged.java Added: trunk/fs/src/fs/org/jnode/fs/FSEntryCreated.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/FSEntryCreated.java (rev 0) +++ trunk/fs/src/fs/org/jnode/fs/FSEntryCreated.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -0,0 +1,10 @@ +package org.jnode.fs; + +import java.io.IOException; + +/** + * Interface to stack on to declare implementation of a {@code getCreated()} method, until JNode adds it to {@link FSEntry}. + */ +public interface FSEntryCreated { + public long getCreated() throws IOException; +} Added: trunk/fs/src/fs/org/jnode/fs/FSEntryLastAccessed.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/FSEntryLastAccessed.java (rev 0) +++ trunk/fs/src/fs/org/jnode/fs/FSEntryLastAccessed.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -0,0 +1,10 @@ +package org.jnode.fs; + +import java.io.IOException; + +/** + * Interface to stack on to declare implementation of a {@code getLastAccessed()} method, until JNode adds it to {@link FSEntry}. + */ +public interface FSEntryLastAccessed { + public long getLastAccessed() throws IOException; +} Added: trunk/fs/src/fs/org/jnode/fs/FSEntryLastChanged.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/FSEntryLastChanged.java (rev 0) +++ trunk/fs/src/fs/org/jnode/fs/FSEntryLastChanged.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -0,0 +1,10 @@ +package org.jnode.fs; + +import java.io.IOException; + +/** + * Interface to stack on to declare implementation of a {@code getLastChanged()} method, until JNode adds it to {@link FSEntry}. + */ +public interface FSEntryLastChanged { + public long getLastChanged() throws IOException; +} Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystemType.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystemType.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystemType.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -22,14 +22,11 @@ import java.io.IOException; import java.nio.ByteBuffer; - import org.jnode.driver.Device; import org.jnode.driver.block.FSBlockDeviceAPI; import org.jnode.fs.BlockDeviceFileSystemType; import org.jnode.fs.FileSystemException; import org.jnode.partitions.PartitionTableEntry; -import org.jnode.partitions.ibm.IBMPartitionTableEntry; -import org.jnode.partitions.ibm.IBMPartitionTypes; /** * @author Andras Nagy @@ -57,6 +54,7 @@ * @see org.jnode.fs.BlockDeviceFileSystemType#supports(PartitionTableEntry, byte[], FSBlockDeviceAPI) */ public boolean supports(PartitionTableEntry pte, byte[] firstSector, FSBlockDeviceAPI devApi) { +/* if (pte != null) { if (pte instanceof IBMPartitionTableEntry) { if (((IBMPartitionTableEntry) pte).getSystemIndicator() != IBMPartitionTypes.PARTTYPE_LINUXNATIVE) { @@ -64,14 +62,19 @@ } } } +*/ //need to check the magic ByteBuffer magic = ByteBuffer.allocate(2); + ByteBuffer revLevel = ByteBuffer.allocate(4); try { devApi.read(1024 + 56, magic); + devApi.read(1024 + 78, revLevel); } catch (IOException e) { return false; } - return (Ext2Utils.get16(magic.array(), 0) == 0xEF53); + return + (Ext2Utils.get16(magic.array(), 0) == 0xEF53) && + (Ext2Utils.get32(revLevel.array(), 0) == 0 || Ext2Utils.get32(revLevel.array(), 0) == 1); } } Modified: trunk/fs/src/fs/org/jnode/fs/fat/Fat.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/fat/Fat.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/fat/Fat.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -24,7 +24,6 @@ import java.io.PrintWriter; import java.nio.ByteBuffer; import java.util.Arrays; - import org.jnode.driver.block.BlockDeviceAPI; import org.jnode.fs.FileSystemFullException; @@ -198,6 +197,7 @@ while (!isEofCluster(entries[(int) cluster])) { count++; cluster = entries[(int) cluster]; + testCluster(cluster); // prevent infinite loop in common case where it hits a 0 } // Now create the chain long[] chain = new long[count]; @@ -377,7 +377,7 @@ protected void testCluster(long cluster) throws IllegalArgumentException { if ((cluster < 2) || (cluster >= entries.length)) { - throw new IllegalArgumentException("Invalid cluster value"); + throw new IllegalArgumentException("Invalid cluster value: 0x" + Long.toHexString(cluster)); } } Modified: trunk/fs/src/fs/org/jnode/fs/fat/FatDirEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/fat/FatDirEntry.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/fat/FatDirEntry.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -22,10 +22,11 @@ import java.io.IOException; import java.util.Date; - import org.jnode.fs.FSAccessRights; import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; +import org.jnode.fs.FSEntryCreated; +import org.jnode.fs.FSEntryLastAccessed; import org.jnode.fs.FSFile; import org.jnode.fs.spi.UnixFSAccessRights; import org.jnode.fs.util.DosUtils; @@ -35,7 +36,7 @@ /** * @author epr */ -public class FatDirEntry extends FatBasicDirEntry implements FSEntry { +public class FatDirEntry extends FatBasicDirEntry implements FSEntry, FSEntryCreated, FSEntryLastAccessed { /** Name of this entry */ private String name; Modified: trunk/fs/src/fs/org/jnode/fs/fat/FatFileSystemType.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/fat/FatFileSystemType.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/fat/FatFileSystemType.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -25,8 +25,6 @@ import org.jnode.fs.BlockDeviceFileSystemType; import org.jnode.fs.FileSystemException; import org.jnode.partitions.PartitionTableEntry; -import org.jnode.partitions.ibm.IBMPartitionTableEntry; -import org.jnode.partitions.ibm.IBMPartitionTypes; /** * @author epr @@ -50,6 +48,7 @@ * @param firstSector */ public boolean supports(PartitionTableEntry pte, byte[] firstSector, FSBlockDeviceAPI devApi) { +/* if (pte != null) { if (!pte.isValid()) { return false; @@ -66,14 +65,24 @@ } else { return false; } - } +*/ + try + { if (!new BootSector(firstSector).isaValidBootSector()) return false; + } + catch (RuntimeException e) + { + return false; + } - // Very ugly, but good enough for now. - return true; + // FAT-32 is currently handled by the newer jfat package. + return (firstSector[38] == 0x29 && + firstSector[54] == 'F' && + firstSector[55] == 'A' && + firstSector[56] == 'T'); } /** Modified: trunk/fs/src/fs/org/jnode/fs/fat/LfnEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/fat/LfnEntry.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/fat/LfnEntry.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -22,17 +22,18 @@ import java.io.IOException; import java.util.Vector; - import org.jnode.fs.FSAccessRights; import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; +import org.jnode.fs.FSEntryCreated; +import org.jnode.fs.FSEntryLastAccessed; import org.jnode.fs.FSFile; import org.jnode.fs.FileSystem; /** * @author gbin */ -class LfnEntry implements FSEntry { +class LfnEntry implements FSEntry, FSEntryCreated, FSEntryLastAccessed { // decompacted LFN entry private String fileName; // TODO: Make them available Modified: trunk/fs/src/fs/org/jnode/fs/ftpfs/FTPFSEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ftpfs/FTPFSEntry.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/ftpfs/FTPFSEntry.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -20,13 +20,11 @@ package org.jnode.fs.ftpfs; +import com.enterprisedt.net.ftp.FTPFile; +import java.io.IOException; +import org.jnode.fs.FSAccessRights; import org.jnode.fs.FSEntry; -import org.jnode.fs.FSAccessRights; -import java.io.IOException; - -import com.enterprisedt.net.ftp.FTPFile; - /** * @author Levente S\u00e1ntha */ @@ -77,6 +75,7 @@ /** * Gets the last modification time of this entry. * + * @return the last modification time, in milliseconds since January 1, 1970 UTC. * @throws java.io.IOException */ @@ -86,6 +85,19 @@ } /** + * <p>Gets the last access time of this entry.</p> + * + * <p>This implementation returns <code>0</code> as the FTP library has no means of + * obtaining the access time.</p> + * + * @return the last access time, in milliseconds since January 1, 1970 UTC. + * @throws IOException + */ + public long getLastAccessed() throws IOException { + return 0; + } + + /** * Gets the name of this entry. */ public String getName() { @@ -124,8 +136,9 @@ } /** - * Gets the last modification time of this entry. + * Sets the last modification time of this entry. This implementation does nothing. * + * @param lastModified the new last modification time. * @throws java.io.IOException */ public void setLastModified(long lastModified) throws IOException { @@ -133,6 +146,14 @@ } /** + * Sets the last access time of this entry. This implementation does nothing. + * + * @param lastAccessed the new last access time. + */ + public void setLastAccessed(long lastAccessed) { + } + + /** * Sets the name of this entry. */ public void setName(String newName) throws IOException { Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -21,7 +21,6 @@ package org.jnode.fs.iso9660; import java.io.IOException; - import org.jnode.fs.FSAccessRights; import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; @@ -63,6 +62,10 @@ return entryRecord.getRecordingTime().toJavaMillis(); } + public long getLastAccessed() { + return 0; + } + /** * @see org.jnode.fs.FSEntry#isFile() */ @@ -91,6 +94,10 @@ throw new UnsupportedOperationException("not yet implemented"); } + public void setLastAccessed(long lastAccessed) { + throw new UnsupportedOperationException("Filesystem is read-only"); + } + /** * @see org.jnode.fs.FSEntry#getFile() */ Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatEntry.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatEntry.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -20,20 +20,21 @@ package org.jnode.fs.jfat; +import java.io.FileNotFoundException; +import java.io.IOException; import java.util.Arrays; import java.util.Vector; -import java.io.IOException; -import java.io.FileNotFoundException; - import org.apache.log4j.Logger; -import org.jnode.util.NumberUtils; +import org.jnode.fs.FSAccessRights; +import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; -import org.jnode.fs.FSDirectory; +import org.jnode.fs.FSEntryCreated; +import org.jnode.fs.FSEntryLastAccessed; import org.jnode.fs.FSFile; -import org.jnode.fs.FSAccessRights; +import org.jnode.util.NumberUtils; -public class FatEntry extends FatObject implements FSEntry { +public class FatEntry extends FatObject implements FSEntry, FSEntryCreated, FSEntryLastAccessed { private static final Logger log = Logger.getLogger(FatEntry.class); private String name; Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatFileSystemType.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatFileSystemType.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatFileSystemType.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -25,8 +25,6 @@ import org.jnode.fs.BlockDeviceFileSystemType; import org.jnode.fs.FileSystemException; import org.jnode.partitions.PartitionTableEntry; -import org.jnode.partitions.ibm.IBMPartitionTableEntry; -import org.jnode.partitions.ibm.IBMPartitionTypes; /** @@ -41,6 +39,7 @@ } public boolean supports(PartitionTableEntry pte, byte[] firstSector, FSBlockDeviceAPI devApi) { +/* if (pte != null) { if (!pte.isValid()) return false; @@ -58,8 +57,14 @@ return false; } } +*/ - return false; + // Only supports FAT-32 for now, don't want any false results + // for FAT-16 or FAT-12. + return (firstSector[66] == 0x29 && + firstSector[82] == 'F' && + firstSector[83] == 'A' && + firstSector[84] == 'T'); } public FatFileSystem create(Device device, boolean readOnly) throws FileSystemException { Modified: trunk/fs/src/fs/org/jnode/fs/ntfs/IndexAllocationAttribute.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ntfs/IndexAllocationAttribute.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/ntfs/IndexAllocationAttribute.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -28,14 +28,25 @@ final class IndexAllocationAttribute extends NTFSNonResidentAttribute { /** - * @param fileRecord - * @param offset + * Creates the index allocation attribute. + * + * @param fileRecord the file record. + * @param offset the offset of this attribute into the file record. */ public IndexAllocationAttribute(FileRecord fileRecord, int offset) { super(fileRecord, offset); } /** + * Gets the magic value of this record. + * + * @return the magic value. + */ + public int getMagic() { + return getUInt32AsInt(0x00); + } + + /** * Read an index block starting at a given vcn. * * @param indexRoot Modified: trunk/fs/src/fs/org/jnode/fs/ntfs/IndexEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ntfs/IndexEntry.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/ntfs/IndexEntry.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -20,6 +20,7 @@ package org.jnode.fs.ntfs; +import java.io.UnsupportedEncodingException; /** * Structure accessor of an Index Entry. @@ -91,7 +92,12 @@ } public String getFileName() { - return new String(this.getFileNameAsCharArray()); + try { + //XXX: For Java 6, should use the version that accepts a Charset. + return new String(this.getFileNameAsByteArray(), "UTF-16LE"); + } catch (UnsupportedEncodingException e) { + throw new IllegalStateException("UTF-16LE charset missing from JRE", e); + } } public long getFileReferenceNumber() { @@ -114,16 +120,15 @@ } public long getSubnodeVCN() { - return getUInt32(getSize() - 8); + return getInt64(getSize() - 8); // TODO: getUInt64AsInt + //return getUInt32(getSize() - 8); } - private char[] getFileNameAsCharArray() { + private byte[] getFileNameAsByteArray() { final int len = getUInt8(0x50); - final char[] name = new char[len]; - for (int i = 0; i < len; i++) { - name[i] = getChar16(0x52 + (i * 2)); - } - return name; + final byte[] bytes = new byte[len * 2]; + getData(0x52, bytes, 0, bytes.length); + return bytes; } @Override Modified: trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSEntry.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/fs/ntfs/NTFSEntry.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -21,10 +21,12 @@ package org.jnode.fs.ntfs; import java.io.IOException; - import org.jnode.fs.FSAccessRights; import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; +import org.jnode.fs.FSEntryCreated; +import org.jnode.fs.FSEntryLastAccessed; +import org.jnode.fs.FSEntryLastChanged; import org.jnode.fs.FSFile; import org.jnode.fs.FSObject; import org.jnode.fs.FileSystem; @@ -33,7 +35,7 @@ * @author vali * @author Ewout Prangsma (ep...@us...) */ -public class NTFSEntry implements FSEntry { +public class NTFSEntry implements FSEntry, FSEntryCreated, FSEntryLastChanged, FSEntryLastAccessed { private FSObject cachedFSObject; Modified: trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableEntry.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableEntry.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -20,6 +20,7 @@ package org.jnode.partitions.ibm; +import org.apache.log4j.Logger; import org.jnode.driver.block.CHS; import org.jnode.partitions.PartitionTableEntry; import org.jnode.util.LittleEndian; @@ -29,6 +30,7 @@ * @author epr */ public class IBMPartitionTableEntry implements PartitionTableEntry { + private final Logger log = Logger.getLogger(getClass()); private final byte[] bs; private final int ofs; @@ -98,7 +100,13 @@ } public IBMPartitionTypes getSystemIndicator() { - return IBMPartitionTypes.valueOf(LittleEndian.getUInt8(bs, ofs + 4)); + int code = LittleEndian.getUInt8(bs, ofs + 4); + try { + return IBMPartitionTypes.valueOf(code); + } catch (IllegalArgumentException e) { + log.warn("Invalid system indicator code: 0x" + Integer.toHexString(code)); + return IBMPartitionTypes.PARTTYPE_EMPTY; + } } public void setSystemIndicator(IBMPartitionTypes type) { Modified: trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableType.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableType.java 2012-08-10 06:44:27 UTC (rev 5914) +++ trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTableType.java 2012-08-10 06:53:31 UTC (rev 5915) @@ -42,7 +42,6 @@ } public boolean supports(byte[] firstSector, BlockDeviceAPI devApi) { - // TODO Make a suitable implementation - return true; + return IBMPartitionTable.containsPartitionTable(firstSector); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2013-02-20 11:55:14
|
Revision: 5965 http://jnode.svn.sourceforge.net/jnode/?rev=5965&view=rev Author: galatnm Date: 2013-02-20 11:55:05 +0000 (Wed, 20 Feb 2013) Log Message: ----------- Strengthen the checks for IBM partition tables. (Luke Quinane) Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/ntfs/CompressedDataRun.java trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTable.java Modified: trunk/fs/src/fs/org/jnode/fs/ntfs/CompressedDataRun.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ntfs/CompressedDataRun.java 2013-02-20 08:18:08 UTC (rev 5964) +++ trunk/fs/src/fs/org/jnode/fs/ntfs/CompressedDataRun.java 2013-02-20 11:55:05 UTC (rev 5965) @@ -224,7 +224,7 @@ @Override public long mapVcnToLcn(long vcn) { - throw new UnsupportedOperationException("Not yet implemented"); + return compressedRun.mapVcnToLcn(vcn); } /** Modified: trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTable.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTable.java 2013-02-20 08:18:08 UTC (rev 5964) +++ trunk/fs/src/fs/org/jnode/partitions/ibm/IBMPartitionTable.java 2013-02-20 11:55:05 UTC (rev 5965) @@ -33,6 +33,7 @@ import org.jnode.driver.bus.ide.IDEConstants; import org.jnode.partitions.PartitionTable; import org.jnode.partitions.PartitionTableType; +import org.jnode.util.LittleEndian; /** * @author epr @@ -125,18 +126,56 @@ } /** - * Does the given bootsector contain an IBM partition table? + * Does the given boot sector contain an IBM partition table? * - * @param bootSector + * @param bootSector the data to check. + * @return {@code true} if the data contains an IBM partition table, {@code false} otherwise. */ public static boolean containsPartitionTable(byte[] bootSector) { - if ((bootSector[510] & 0xFF) != 0x55) { + if (LittleEndian.getUInt16(bootSector, 510) != 0xaa55) { return false; } - if ((bootSector[511] & 0xFF) != 0xAA) { - return false; + + if (LittleEndian.getUInt16(bootSector, 428) == 0x5678) { + // Matches the AAP MBR extra signature, probably an valid partition table + return true; } - return true; + + if (LittleEndian.getUInt16(bootSector, 380) == 0xa55a) { + // Matches the AST/NEC MBR extra signature, probably an valid partition table + return true; + } + + if (LittleEndian.getUInt16(bootSector, 252) == 0x55aa) { + // Matches the Disk Manager MBR extra signature, probably an valid partition table + return true; + } + + if (LittleEndian.getUInt32(bootSector, 2) == 0x4c57454e) { + // Matches the NEWLDR MBR extra signature, probably an valid partition table + return true; + } + + // Nothing matched, fall back to validating any specified partition entries + IBMPartitionTableEntry lastValid = null; + boolean foundValidEntry = false; + for (int partitionNumber = 0; partitionNumber < TABLE_SIZE; partitionNumber++) { + IBMPartitionTableEntry partition = new IBMPartitionTableEntry(null, bootSector, partitionNumber); + + if (partition.isValid()) { + if (lastValid != null) { + if (lastValid.getStartLba() + lastValid.getNrSectors() > partition.getStartLba()) { + // End of previous partition entry after the start of the next one + return false; + } + } + + foundValidEntry = true; + lastValid = partition; + } + } + + return foundValidEntry; } public Iterator<IBMPartitionTableEntry> iterator() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |