From: <ls...@us...> - 2008-08-25 20:03:19
|
Revision: 4501 http://jnode.svn.sourceforge.net/jnode/?rev=4501&view=rev Author: lsantha Date: 2008-08-25 20:03:09 +0000 (Mon, 25 Aug 2008) Log Message: ----------- Synchronized access to directory entries. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/jfat/FatDirectory.java trunk/fs/src/fs/org/jnode/fs/jfat/FatTable.java Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatDirectory.java 2008-08-25 17:59:16 UTC (rev 4500) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatDirectory.java 2008-08-25 20:03:09 UTC (rev 4501) @@ -129,7 +129,7 @@ f.createNextEntry(); } - public FSEntry getEntry(String name) { + public synchronized FSEntry getEntry(String name) { FatEntry child = children.get(name); if (child == null) { @@ -197,7 +197,7 @@ return true; } - public FSEntry addFile(String name) throws IOException { + public synchronized FSEntry addFile(String name) throws IOException { FatName fatName = new FatName(this, name); if (collide(fatName.getLongName())) throw new IOException("File [" + fatName.getLongName() + "] already exists"); @@ -208,7 +208,7 @@ return children.put(file); } - public FSEntry addDirectory(String name) throws IOException { + public synchronized FSEntry addDirectory(String name) throws IOException { FatFileSystem fs = getFatFileSystem(); FatName fatName = new FatName(this, name); if (collide(fatName.getLongName())) @@ -221,7 +221,7 @@ return children.put(dir); } - public void remove(String name) throws IOException { + public synchronized void remove(String name) throws IOException { FatEntry entry = (FatEntry) getEntry(name); if (entry == null) throw new FileNotFoundException(name); Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatTable.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jfat/FatTable.java 2008-08-25 17:59:16 UTC (rev 4500) +++ trunk/fs/src/fs/org/jnode/fs/jfat/FatTable.java 2008-08-25 20:03:09 UTC (rev 4501) @@ -4,10 +4,11 @@ package org.jnode.fs.jfat; import java.util.Iterator; -import java.util.Hashtable; +import java.util.HashMap; +import java.util.Map; public class FatTable { - private final Hashtable<FatKey, FatEntry> table = new Hashtable<FatKey, FatEntry>(); + private final Map<FatKey, FatEntry> table = new HashMap<FatKey, FatEntry>(); public FatTable() { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |