Changed signatures of directory listing returning methods to

SortedMap where appropriate.  Fixed embarassing accumulation of
broken javadocs.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3258 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-06-27 23:29:57 +00:00
parent 39728a6f86
commit be6dd8c9dc
26 changed files with 86 additions and 81 deletions

View File

@@ -79,14 +79,15 @@ interface AVMNode
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @param name The name of this in the current context.
* @return The descriptor for this node. * @return The descriptor for this node.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath, String name); public AVMNodeDescriptor getDescriptor(Lookup lPath, String name);
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @return The descriptor for this node. * @return The descriptor for this node.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath); public AVMNodeDescriptor getDescriptor(Lookup lPath);

View File

@@ -290,7 +290,7 @@ public class AVMNodeDescriptor
/** /**
* Get the layer id of this node. * Get the layer id of this node.
* @return * @return The layer id if there is one or -1.
*/ */
public long getLayerID() public long getLayerID()
{ {

View File

@@ -94,7 +94,7 @@ abstract class AVMNodeImpl implements AVMNode, Serializable
/** /**
* Set the ancestor of this node. * Set the ancestor of this node.
* @param ancector The ancestor to set. * @param ancestor The ancestor to set.
*/ */
public void setAncestor(AVMNode ancestor) public void setAncestor(AVMNode ancestor)
{ {
@@ -279,7 +279,7 @@ abstract class AVMNodeImpl implements AVMNode, Serializable
/** /**
* Get the version for concurrency control. * Get the version for concurrency control.
* @return * @return The version for optimistic locks.
*/ */
protected long getVers() protected long getVers()
{ {
@@ -287,7 +287,8 @@ abstract class AVMNodeImpl implements AVMNode, Serializable
} }
/** /**
* @return * Get whether this is a root node.
* @return Whether this is a root node.
*/ */
public boolean getIsRoot() public boolean getIsRoot()
{ {

View File

@@ -22,7 +22,7 @@ import java.io.OutputStream;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.SortedMap;
/** /**
* This is the service interface for the [Alfresco|Addled|Advanced|Aleatoric|Apotheosed|Awful] * This is the service interface for the [Alfresco|Addled|Advanced|Aleatoric|Apotheosed|Awful]
@@ -70,26 +70,25 @@ public interface AVMService
* @param path The simple absolute path to the file node. * @param path The simple absolute path to the file node.
* @return A List of FolderEntrys. * @return A List of FolderEntrys.
*/ */
public Map<String, AVMNodeDescriptor> getDirectoryListing(int version, String path); public SortedMap<String, AVMNodeDescriptor> getDirectoryListing(int version, String path);
/** /**
* Get a directory listing from a node descriptor. * Get a directory listing from a node descriptor.
* @param dir The directory node descriptor. * @param dir The directory node descriptor.
* @return A Map of names to node descriptors. * @return A Map of names to node descriptors.
*/ */
public Map<String, AVMNodeDescriptor> getDirectoryListing(AVMNodeDescriptor dir); public SortedMap<String, AVMNodeDescriptor> getDirectoryListing(AVMNodeDescriptor dir);
/** /**
* Create a new File. Fails if the file already exists. * Create a new File. Fails if the file already exists.
* @param path The simple absolute path to the parent. * @param path The simple absolute path to the parent.
* @param name The name to give the file. * @param name The name to give the file.
* @param source A possibly null stream to draw initial contents from.
*/ */
public OutputStream createFile(String path, String name); public OutputStream createFile(String path, String name);
/** /**
* Create a new directory. * Create a new directory.
* @param parent The simple absolute path to the parent. * @param path The simple absolute path to the parent.
* @param name The name to give the folder. * @param name The name to give the folder.
*/ */
public void createDirectory(String path, String name); public void createDirectory(String path, String name);

View File

@@ -23,7 +23,7 @@ import java.io.OutputStream;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.SortedMap;
import org.alfresco.repo.avm.SuperRepository; import org.alfresco.repo.avm.SuperRepository;
import org.alfresco.repo.avm.hibernate.HibernateHelper; import org.alfresco.repo.avm.hibernate.HibernateHelper;
@@ -76,7 +76,6 @@ public class AVMServiceImpl implements AVMService
/** /**
* Basic constructor for the service. * Basic constructor for the service.
* @param createTables Flag for whether tables should be created.
*/ */
public AVMServiceImpl() public AVMServiceImpl()
{ {
@@ -241,7 +240,7 @@ public class AVMServiceImpl implements AVMService
/* (non-Javadoc) /* (non-Javadoc)
* @see org.alfresco.repo.avm.AVMService#getFolderListing(int, java.lang.String) * @see org.alfresco.repo.avm.AVMService#getFolderListing(int, java.lang.String)
*/ */
public Map<String, AVMNodeDescriptor> getDirectoryListing(final int version, final String path) public SortedMap<String, AVMNodeDescriptor> getDirectoryListing(final int version, final String path)
{ {
if (path == null) if (path == null)
{ {
@@ -249,7 +248,7 @@ public class AVMServiceImpl implements AVMService
} }
class HTxnCallback implements HibernateTxnCallback class HTxnCallback implements HibernateTxnCallback
{ {
public Map<String, AVMNodeDescriptor> listing; public SortedMap<String, AVMNodeDescriptor> listing;
public void perform(Session session) public void perform(Session session)
{ {
@@ -267,7 +266,7 @@ public class AVMServiceImpl implements AVMService
* @param dir The directory node descriptor. * @param dir The directory node descriptor.
* @return A Map of names to node descriptors. * @return A Map of names to node descriptors.
*/ */
public Map<String, AVMNodeDescriptor> getDirectoryListing(final AVMNodeDescriptor dir) public SortedMap<String, AVMNodeDescriptor> getDirectoryListing(final AVMNodeDescriptor dir)
{ {
if (dir == null) if (dir == null)
{ {
@@ -275,7 +274,7 @@ public class AVMServiceImpl implements AVMService
} }
class HTxnCallback implements HibernateTxnCallback class HTxnCallback implements HibernateTxnCallback
{ {
public Map<String, AVMNodeDescriptor> listing; public SortedMap<String, AVMNodeDescriptor> listing;
public void perform(Session session) public void perform(Session session)
{ {

View File

@@ -76,7 +76,7 @@ public class AVMServiceTestBase extends TestCase
* Get the recursive contents of the given path and version. * Get the recursive contents of the given path and version.
* @param path * @param path
* @param version * @param version
* @return * @return A string representation of the contents.
*/ */
protected String recursiveContents(String path, int version, boolean followLinks) protected String recursiveContents(String path, int version, boolean followLinks)
{ {

View File

@@ -73,7 +73,7 @@ public class AVMStressTest extends AVMServiceTestBase
thread.start(); thread.start();
} }
int exited = 0; int exited = 0;
long sampStart = System.currentTimeMillis(); // long sampStart = System.currentTimeMillis();
while (exited != nThreads) while (exited != nThreads)
{ {
try try

View File

@@ -80,7 +80,7 @@ public class ChildEntryImpl implements ChildEntry, Serializable
/** /**
* Get the name of this entry. * Get the name of this entry.
* @return * @return The name of this entry.
*/ */
public String getName() public String getName()
{ {
@@ -98,7 +98,7 @@ public class ChildEntryImpl implements ChildEntry, Serializable
/** /**
* Get the parent in this entry. * Get the parent in this entry.
* @return * @return The parent.
*/ */
public DirectoryNode getParent() public DirectoryNode getParent()
{ {
@@ -116,7 +116,7 @@ public class ChildEntryImpl implements ChildEntry, Serializable
/** /**
* Get the child in this entry. * Get the child in this entry.
* @return * @return The child.
*/ */
public AVMNode getChild() public AVMNode getChild()
{ {
@@ -124,8 +124,9 @@ public class ChildEntryImpl implements ChildEntry, Serializable
} }
/** /**
* Equals override.
* @param obj * @param obj
* @return * @return Equality.
*/ */
@Override @Override
public boolean equals(Object obj) public boolean equals(Object obj)
@@ -143,7 +144,8 @@ public class ChildEntryImpl implements ChildEntry, Serializable
} }
/** /**
* @return * Get the hash code.
* @return The hash code.
*/ */
@Override @Override
public int hashCode() public int hashCode()
@@ -152,7 +154,8 @@ public class ChildEntryImpl implements ChildEntry, Serializable
} }
/** /**
* @return the vers * Get the version for optimistic locking.
* @return The version for optimistic locking.
*/ */
protected long getVers() protected long getVers()
{ {
@@ -160,6 +163,7 @@ public class ChildEntryImpl implements ChildEntry, Serializable
} }
/** /**
* Set the version for optimistic locking.
* @param vers the vers to set * @param vers the vers to set
*/ */
protected void setVers(long vers) protected void setVers(long vers)

View File

@@ -95,7 +95,7 @@ public class DeletedChildImpl implements DeletedChild, Serializable
/** /**
* Equality in the database entity sense. * Equality in the database entity sense.
* @param obj * @param obj
* @return * @return Equality.
*/ */
@Override @Override
public boolean equals(Object obj) public boolean equals(Object obj)
@@ -113,6 +113,7 @@ public class DeletedChildImpl implements DeletedChild, Serializable
} }
/** /**
* Get a hash code.
* @return A hash code. * @return A hash code.
*/ */
@Override @Override

View File

@@ -18,6 +18,7 @@ package org.alfresco.repo.avm;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.SortedMap;
/** /**
* The interface for Directory Nodes. * The interface for Directory Nodes.
@@ -65,8 +66,7 @@ interface DirectoryNode extends AVMNode
/** /**
* Get a directory listing. * Get a directory listing.
* @param lPath The lookup context. * @param lPath The lookup context.
* @param version The version to look under. * @return A SortedMap of names to DirectoryEntries.
* @return A Map of names to DirectoryEntries.
*/ */
public Map<String, AVMNode> getListing(Lookup lPath); public Map<String, AVMNode> getListing(Lookup lPath);
@@ -75,7 +75,7 @@ interface DirectoryNode extends AVMNode
* @param dir The directory to list. * @param dir The directory to list.
* @return A Map of names to node descriptors * @return A Map of names to node descriptors
*/ */
public Map<String, AVMNodeDescriptor> getListing(AVMNodeDescriptor dir); public SortedMap<String, AVMNodeDescriptor> getListing(AVMNodeDescriptor dir);
/** /**
* Set the directory, which must be in a layer, into a primary * Set the directory, which must be in a layer, into a primary

View File

@@ -64,7 +64,6 @@ interface FileContent
/** /**
* Get the length of the file. * Get the length of the file.
* @param superRepo
* @return The length of the file. * @return The length of the file.
*/ */
public long getLength(); public long getLength();

View File

@@ -182,7 +182,6 @@ class FileContentImpl implements FileContent, Serializable
* Get a random access file from this content. It's the responsibility of * Get a random access file from this content. It's the responsibility of
* the caller of this to insure that this object has been copied if the * the caller of this to insure that this object has been copied if the
* access argument is a write mode. * access argument is a write mode.
* @param superRepo The SuperRepository.
* @param access The access more for RandomAccessFile. * @param access The access more for RandomAccessFile.
* @return A RandomAccessFile. * @return A RandomAccessFile.
*/ */
@@ -300,7 +299,7 @@ class FileContentImpl implements FileContent, Serializable
/** /**
* Equals predicate. Based on object ID. * Equals predicate. Based on object ID.
* @param obj The obect to compare against. * @param obj The obect to compare against.
* @return * @return Equality.
*/ */
@Override @Override
public boolean equals(Object obj) public boolean equals(Object obj)

View File

@@ -43,7 +43,7 @@ interface HistoryLink
/** /**
* Get the descendent part of this. * Get the descendent part of this.
* @return * @return The descendent of this link.
*/ */
public AVMNode getDescendent(); public AVMNode getDescendent();
} }

View File

@@ -74,8 +74,9 @@ class HistoryLinkImpl implements HistoryLink, Serializable
} }
/** /**
* Equals override.
* @param obj * @param obj
* @return * @return Equality.
*/ */
@Override @Override
public boolean equals(Object obj) public boolean equals(Object obj)
@@ -94,7 +95,8 @@ class HistoryLinkImpl implements HistoryLink, Serializable
} }
/** /**
* @return * Get the hashcode.
* @return The hashcode.
*/ */
@Override @Override
public int hashCode() public int hashCode()

View File

@@ -4,7 +4,7 @@
package org.alfresco.repo.avm; package org.alfresco.repo.avm;
/** /**
* Layered nodes share this method. * Layered nodes share these methods.
* @author britt * @author britt
*/ */
interface Layered interface Layered
@@ -14,7 +14,7 @@ interface Layered
* node points to. * node points to.
* @param lookup The lookup path. Needed for most nodes to determine * @param lookup The lookup path. Needed for most nodes to determine
* underlying path. * underlying path.
* @return * @return The underlying indirection.
*/ */
public String getUnderlying(Lookup lookup); public String getUnderlying(Lookup lookup);

View File

@@ -10,7 +10,7 @@ interface LayeredDirectoryNode extends DirectoryNode, Layered
{ {
/** /**
* Does this node have a primary indirection. * Does this node have a primary indirection.
* @returns Whether this is a primary indirection. * @return Whether this is a primary indirection.
*/ */
public boolean getPrimaryIndirection(); public boolean getPrimaryIndirection();
@@ -28,7 +28,7 @@ interface LayeredDirectoryNode extends DirectoryNode, Layered
/** /**
* Set the layer id for this node. * Set the layer id for this node.
* @param layerID The id to set. * @param id The id to set.
*/ */
public void setLayerID(long id); public void setLayerID(long id);

View File

@@ -21,6 +21,7 @@ import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import org.hibernate.Query; import org.hibernate.Query;
@@ -68,7 +69,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
/** /**
* Make a new one from a specified indirection path. * Make a new one from a specified indirection path.
* @param indirection The indirection path to set. * @param indirection The indirection path to set.
* @param repository The repository that owns this node. * @param repos The repository that owns this node.
*/ */
public LayeredDirectoryNodeImpl(String indirection, Repository repos) public LayeredDirectoryNodeImpl(String indirection, Repository repos)
{ {
@@ -329,7 +330,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
} }
} }
// Filter the base listing by taking out anything in the deleted Set. // Filter the base listing by taking out anything in the deleted Set.
Map<String, AVMNode> listing = new TreeMap<String, AVMNode>(); Map<String, AVMNode> listing = new HashMap<String, AVMNode>();
for (String name : baseListing.keySet()) for (String name : baseListing.keySet())
{ {
if (getDeleted(name) != null) if (getDeleted(name) != null)
@@ -350,13 +351,13 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
* @param dir The directory node descriptor. * @param dir The directory node descriptor.
* @return A Map of names to node descriptors. * @return A Map of names to node descriptors.
*/ */
public Map<String, AVMNodeDescriptor> getListing(AVMNodeDescriptor dir) public SortedMap<String, AVMNodeDescriptor> getListing(AVMNodeDescriptor dir)
{ {
if (dir.getPath() == null || dir.getIndirection() == null) if (dir.getPath() == null || dir.getIndirection() == null)
{ {
throw new AVMBadArgumentException("Illegal null argument."); throw new AVMBadArgumentException("Illegal null argument.");
} }
Map<String, AVMNodeDescriptor> baseListing = new TreeMap<String, AVMNodeDescriptor>(); SortedMap<String, AVMNodeDescriptor> baseListing = new TreeMap<String, AVMNodeDescriptor>();
// If we are not opaque, get the underlying base listing. // If we are not opaque, get the underlying base listing.
if (!fOpacity) if (!fOpacity)
{ {
@@ -570,7 +571,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @return A descriptor. * @return A descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath, String name) public AVMNodeDescriptor getDescriptor(Lookup lPath, String name)
@@ -605,7 +606,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @return A descriptor. * @return A descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath) public AVMNodeDescriptor getDescriptor(Lookup lPath)
@@ -636,7 +637,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
* @param parentPath The parent path. * @param parentPath The parent path.
* @param name The name this was looked up with. * @param name The name this was looked up with.
* @param parentIndirection The indirection of the parent. * @param parentIndirection The indirection of the parent.
* @return * @return The descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(String parentPath, String name, String parentIndirection) public AVMNodeDescriptor getDescriptor(String parentPath, String name, String parentIndirection)
{ {

View File

@@ -95,7 +95,6 @@ class LayeredFileNodeImpl extends FileNodeImpl implements LayeredFileNode
/** /**
* Get the content of the specified version. * Get the content of the specified version.
* @param repo The Repository.
* @return A FileContent object. * @return A FileContent object.
*/ */
public FileContent getContentForRead() public FileContent getContentForRead()
@@ -143,7 +142,7 @@ class LayeredFileNodeImpl extends FileNodeImpl implements LayeredFileNode
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @return A descriptor. * @return A descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath, String name) public AVMNodeDescriptor getDescriptor(Lookup lPath, String name)
@@ -178,7 +177,7 @@ class LayeredFileNodeImpl extends FileNodeImpl implements LayeredFileNode
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @return A descriptor. * @return A descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath) public AVMNodeDescriptor getDescriptor(Lookup lPath)
@@ -208,7 +207,7 @@ class LayeredFileNodeImpl extends FileNodeImpl implements LayeredFileNode
* @param parentPath The parent path. * @param parentPath The parent path.
* @param name The name this was looked up with. * @param name The name this was looked up with.
* @param parentIndirection The parent indirection. * @param parentIndirection The parent indirection.
* @return * @return The descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(String parentPath, String name, String parentIndirection) public AVMNodeDescriptor getDescriptor(String parentPath, String name, String parentIndirection)
{ {

View File

@@ -74,8 +74,9 @@ class MergeLinkImpl implements MergeLink, Serializable
} }
/** /**
* Override of equals.
* @param obj * @param obj
* @return * @return Equality.
*/ */
@Override @Override
public boolean equals(Object obj) public boolean equals(Object obj)
@@ -93,7 +94,8 @@ class MergeLinkImpl implements MergeLink, Serializable
} }
/** /**
* @return * Get the hash code.
* @return The hash code.
*/ */
@Override @Override
public int hashCode() public int hashCode()

View File

@@ -20,6 +20,7 @@ package org.alfresco.repo.avm;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import org.hibernate.Session; import org.hibernate.Session;
@@ -85,7 +86,6 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
/** /**
* Get a directory listing. * Get a directory listing.
* @param lPath The lookup path. * @param lPath The lookup path.
* @param version Which version.
* @return The listing. * @return The listing.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -105,13 +105,13 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
* @param dir The directory node descriptor. * @param dir The directory node descriptor.
* @return A Map of names to node descriptors. * @return A Map of names to node descriptors.
*/ */
public Map<String, AVMNodeDescriptor> getListing(AVMNodeDescriptor dir) public SortedMap<String, AVMNodeDescriptor> getListing(AVMNodeDescriptor dir)
{ {
if (dir.getPath() == null) if (dir.getPath() == null)
{ {
throw new AVMBadArgumentException("Path is null."); throw new AVMBadArgumentException("Path is null.");
} }
TreeMap<String, AVMNodeDescriptor> result = new TreeMap<String, AVMNodeDescriptor>(); SortedMap<String, AVMNodeDescriptor> result = new TreeMap<String, AVMNodeDescriptor>();
List<ChildEntry> children = getChildren(); List<ChildEntry> children = getChildren();
for (ChildEntry child : children) for (ChildEntry child : children)
{ {
@@ -200,7 +200,7 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
/** /**
* Copy on write logic. * Copy on write logic.
* @param lPath The lookup path. * @param lPath The lookup path.
* @return * @return A brand new copied version.
*/ */
public AVMNode copy(Lookup lPath) public AVMNode copy(Lookup lPath)
{ {
@@ -265,7 +265,8 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @param name The name of this node in this context.
* @return A descriptor. * @return A descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath, String name) public AVMNodeDescriptor getDescriptor(Lookup lPath, String name)
@@ -300,7 +301,7 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @return A descriptor. * @return A descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath) public AVMNodeDescriptor getDescriptor(Lookup lPath)

View File

@@ -42,7 +42,6 @@ class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
* Make one from just a repository. * Make one from just a repository.
* This is the constructor used when a brand new plain file is being made. * This is the constructor used when a brand new plain file is being made.
* @param repos A Repository. * @param repos A Repository.
* @param source A possibly null stream from which to get data.
*/ */
public PlainFileNodeImpl(Repository repos) public PlainFileNodeImpl(Repository repos)
{ {
@@ -133,7 +132,7 @@ class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @return A descriptor. * @return A descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath, String name) public AVMNodeDescriptor getDescriptor(Lookup lPath, String name)
@@ -168,7 +167,7 @@ class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
/** /**
* Get the descriptor for this node. * Get the descriptor for this node.
* @param The Lookup. * @param lPath The Lookup.
* @return A descriptor. * @return A descriptor.
*/ */
public AVMNodeDescriptor getDescriptor(Lookup lPath) public AVMNodeDescriptor getDescriptor(Lookup lPath)

View File

@@ -21,7 +21,7 @@ import java.io.OutputStream;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.SortedMap;
/** /**
* The repository interface. Methods for filesystem like, versioning, * The repository interface. Methods for filesystem like, versioning,
@@ -69,7 +69,7 @@ interface Repository
* Create a new file. The designated file cannot already exist. * Create a new file. The designated file cannot already exist.
* @param path The path to the directory to contain the new file. * @param path The path to the directory to contain the new file.
* @param name The name to give the new file. * @param name The name to give the new file.
* @param source An InputStream of data to put in the file. May be null. * @return An OutputStream.
*/ */
public OutputStream createFile(String path, String name); public OutputStream createFile(String path, String name);
@@ -95,7 +95,7 @@ interface Repository
* @param path The path to the directory. * @param path The path to the directory.
* @return A listing. * @return A listing.
*/ */
public Map<String, AVMNodeDescriptor> getListing(int version, String path); public SortedMap<String, AVMNodeDescriptor> getListing(int version, String path);
/** /**
* Get an output stream to a file. * Get an output stream to a file.

View File

@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import org.hibernate.Query; import org.hibernate.Query;
@@ -222,7 +223,6 @@ class RepositoryImpl implements Repository, Serializable
* Create a new file. * Create a new file.
* @param path The path to the directory to contain the new file. * @param path The path to the directory to contain the new file.
* @param name The name to give the new file. * @param name The name to give the new file.
* @param source A (possibly null) InputStream from which to get
* initial content. * initial content.
*/ */
public OutputStream createFile(String path, String name) public OutputStream createFile(String path, String name)
@@ -288,12 +288,12 @@ class RepositoryImpl implements Repository, Serializable
* @param path The path to the directory. * @param path The path to the directory.
* @return A List of FolderEntries. * @return A List of FolderEntries.
*/ */
public Map<String, AVMNodeDescriptor> getListing(int version, String path) public SortedMap<String, AVMNodeDescriptor> getListing(int version, String path)
{ {
Lookup lPath = lookupDirectory(version, path, false); Lookup lPath = lookupDirectory(version, path, false);
DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode();
Map<String, AVMNode> listing = dir.getListing(lPath); Map<String, AVMNode> listing = dir.getListing(lPath);
Map<String, AVMNodeDescriptor> results = new TreeMap<String, AVMNodeDescriptor>(); SortedMap<String, AVMNodeDescriptor> results = new TreeMap<String, AVMNodeDescriptor>();
for (String name : listing.keySet()) for (String name : listing.keySet())
{ {
AVMNode child = listing.get(name); AVMNode child = listing.get(name);
@@ -728,8 +728,9 @@ class RepositoryImpl implements Repository, Serializable
} }
/** /**
* Equals override.
* @param obj * @param obj
* @return * @return Equality.
*/ */
@Override @Override
public boolean equals(Object obj) public boolean equals(Object obj)
@@ -746,13 +747,13 @@ class RepositoryImpl implements Repository, Serializable
} }
/** /**
* @return * Get a hash code.
* @return The hash code.
*/ */
@Override @Override
public int hashCode() public int hashCode()
{ {
// TODO Auto-generated method stub return fName.hashCode();
return super.hashCode();
} }
/** /**
@@ -829,7 +830,7 @@ class RepositoryImpl implements Repository, Serializable
/** /**
* Get the descriptor for this. * Get the descriptor for this.
* @return * @return A RepositoryDescriptor
*/ */
public RepositoryDescriptor getDescriptor() public RepositoryDescriptor getDescriptor()
{ {

View File

@@ -24,7 +24,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.SortedMap;
import org.hibernate.LockMode; import org.hibernate.LockMode;
import org.hibernate.Query; import org.hibernate.Query;
@@ -76,7 +76,6 @@ class SuperRepository
* Create a new one. It's given issuers and a storage directory. * Create a new one. It's given issuers and a storage directory.
* @param nodeIssuer * @param nodeIssuer
* @param contentIssuer * @param contentIssuer
* @param branchIssuer
* @param layerIssuer * @param layerIssuer
* @param storage * @param storage
*/ */
@@ -108,7 +107,6 @@ class SuperRepository
* Create a file. * Create a file.
* @param path The path to the containing directory. * @param path The path to the containing directory.
* @param name The name for the new file. * @param name The name for the new file.
* @param source A (possibly null) InputStream with content for the new file.
*/ */
public OutputStream createFile(String path, String name) public OutputStream createFile(String path, String name)
{ {
@@ -542,7 +540,7 @@ class SuperRepository
* @param path The path to the directory. * @param path The path to the directory.
* @return A List of FolderEntries. * @return A List of FolderEntries.
*/ */
public Map<String, AVMNodeDescriptor> getListing(int version, String path) public SortedMap<String, AVMNodeDescriptor> getListing(int version, String path)
{ {
fLookupCount.set(1); fLookupCount.set(1);
String [] pathParts = SplitPath(path); String [] pathParts = SplitPath(path);
@@ -554,9 +552,9 @@ class SuperRepository
/** /**
* Get a directory listing from a directory node descriptor. * Get a directory listing from a directory node descriptor.
* @param dir The directory node descriptor. * @param dir The directory node descriptor.
* @return * @return A SortedMap listing.
*/ */
public Map<String, AVMNodeDescriptor> getListing(AVMNodeDescriptor dir) public SortedMap<String, AVMNodeDescriptor> getListing(AVMNodeDescriptor dir)
{ {
fLookupCount.set(1); fLookupCount.set(1);
AVMNode node = (AVMNode)fSession.get().get(AVMNodeImpl.class, dir.getId()); AVMNode node = (AVMNode)fSession.get().get(AVMNodeImpl.class, dir.getId());
@@ -894,7 +892,7 @@ class SuperRepository
/** /**
* Get the single instance of SuperRepository. * Get the single instance of SuperRepository.
* @return * @return The single instance.
*/ */
public static SuperRepository GetInstance() public static SuperRepository GetInstance()
{ {

View File

@@ -157,7 +157,7 @@ public class VersionRootImpl implements VersionRoot, Serializable
/** /**
* Check equality. Based on Repository equality and version id equality. * Check equality. Based on Repository equality and version id equality.
* @param obj * @param obj
* @return * @return Equality.
*/ */
@Override @Override
public boolean equals(Object obj) public boolean equals(Object obj)

View File

@@ -67,7 +67,6 @@ public class HibernateTxn
* Keep trying if the operation fails because of a concurrency issue. * Keep trying if the operation fails because of a concurrency issue.
* @param callback The worker. * @param callback The worker.
* @param write Whether this is a write operation. * @param write Whether this is a write operation.
* @return Whether the operation finished with a commit.
*/ */
public void perform(HibernateTxnCallback callback, boolean write) public void perform(HibernateTxnCallback callback, boolean write)
{ {