private Collection getDirEntries(FSRevisionNode parent, SVNURL parentURL, int entryFields) throws SVNException { Map entries = parent.getDirEntries(myFSFS); Set keys = entries.keySet(); Iterator dirEntries = keys.iterator(); Collection dirEntriesList = new LinkedList(); while (dirEntries.hasNext()) { String name = (String) dirEntries.next(); FSEntry repEntry = (FSEntry) entries.get(name); if (repEntry != null) { dirEntriesList.add(buildDirEntry(repEntry, parentURL, null, entryFields)); } } return dirEntriesList; }
private Collection getDirEntries(FSRevisionNode parent, SVNURL parentURL, int entryFields) throws SVNException { Map entries = parent.getDirEntries(myFSFS); Set keys = entries.keySet(); Iterator dirEntries = keys.iterator(); Collection dirEntriesList = new LinkedList(); while (dirEntries.hasNext()) { String name = (String) dirEntries.next(); FSEntry repEntry = (FSEntry) entries.get(name); if (repEntry != null) { dirEntriesList.add(buildDirEntry(repEntry, parentURL, null, entryFields)); } } return dirEntriesList; }
private Collection getDirEntries(FSRevisionNode parent, SVNURL parentURL, boolean includeLogs) throws SVNException { Map entries = parent.getDirEntries(myFSFS); Set keys = entries.keySet(); Iterator dirEntries = keys.iterator(); Collection dirEntriesList = new LinkedList(); while (dirEntries.hasNext()) { String name = (String) dirEntries.next(); FSEntry repEntry = (FSEntry) entries.get(name); if (repEntry != null) { dirEntriesList.add(buildDirEntry(repEntry, parentURL, null, includeLogs)); } } return dirEntriesList; }
private Collection getDirEntries(FSRevisionNode parent, SVNURL parentURL, int entryFields) throws SVNException { Map entries = parent.getDirEntries(myFSFS); Set keys = entries.keySet(); Iterator dirEntries = keys.iterator(); Collection dirEntriesList = new LinkedList(); while (dirEntries.hasNext()) { String name = (String) dirEntries.next(); FSEntry repEntry = (FSEntry) entries.get(name); if (repEntry != null) { dirEntriesList.add(buildDirEntry(repEntry, parentURL, null, entryFields)); } } return dirEntriesList; }
public void closeDir() throws SVNException { if (myIsVerify) { FSRevisionNode node = myRoot.getRevisionNode(myCurrentDirInfo.myFullPath); Map entries = node.getDirEntries(myFSFS); for (Iterator entriesIter = entries.keySet().iterator(); entriesIter.hasNext();) { String entryName = (String) entriesIter.next(); String entryPath = SVNPathUtil.append(myCurrentDirInfo.myFullPath, entryName); SVNNodeKind kind = myRoot.checkNodeKind(entryPath); FSRevisionNode entryNode = myRoot.getRevisionNode(entryPath); if (kind == SVNNodeKind.DIR) { entryNode.getDirEntries(myFSFS); } else if (kind == SVNNodeKind.FILE) { entryNode.getFileLength(); } else { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "Unexpected node kind {0} for ''{1}''", new Object[] { kind, entryPath }); SVNErrorManager.error(err, SVNLogType.FSFS); } } } for (Iterator entries = myCurrentDirInfo.myDeletedEntries.keySet().iterator(); entries.hasNext();) { String path = (String) entries.next(); dumpNode(path, SVNNodeKind.UNKNOWN, SVNAdminHelper.NODE_ACTION_DELETE, false, null, -1); } myCurrentDirInfo = myCurrentDirInfo.myParentInfo; }
public void closeDir() throws SVNException { if (myIsVerify) { FSRevisionNode node = myRoot.getRevisionNode(myCurrentDirInfo.myFullPath); Map entries = node.getDirEntries(myFSFS); for (Iterator entriesIter = entries.keySet().iterator(); entriesIter.hasNext();) { String entryName = (String) entriesIter.next(); String entryPath = SVNPathUtil.append(myCurrentDirInfo.myFullPath, entryName); SVNNodeKind kind = myRoot.checkNodeKind(entryPath); FSRevisionNode entryNode = myRoot.getRevisionNode(entryPath); if (kind == SVNNodeKind.DIR) { entryNode.getDirEntries(myFSFS); } else if (kind == SVNNodeKind.FILE) { entryNode.getFileLength(); } else { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "Unexpected node kind {0} for ''{1}''", new Object[] { kind, entryPath }); SVNErrorManager.error(err, SVNLogType.FSFS); } } } for (Iterator entries = myCurrentDirInfo.myDeletedEntries.keySet().iterator(); entries.hasNext();) { String path = (String) entries.next(); dumpNode(path, SVNNodeKind.UNKNOWN, SVNAdminHelper.NODE_ACTION_DELETE, false, null, -1); } myCurrentDirInfo = myCurrentDirInfo.myParentInfo; }
private void deleteEntryIfMutable(FSID id) throws SVNException { FSRevisionNode node = getOwner().getRevisionNode(id); if (!node.getId().isTxn()) { return; } if (node.getType() == SVNNodeKind.DIR) { Map entries = node.getDirEntries(getOwner()); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); deleteEntryIfMutable(entry.getId()); } } removeRevisionNode(id); }
private void deleteEntryIfMutable(FSID id) throws SVNException { FSRevisionNode node = getOwner().getRevisionNode(id); if (!node.getId().isTxn()) { return; } if (node.getType() == SVNNodeKind.DIR) { Map entries = node.getDirEntries(getOwner()); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); deleteEntryIfMutable(entry.getId()); } } removeRevisionNode(id); }
private void deleteEntryIfMutable(FSID id) throws SVNException { FSRevisionNode node = getOwner().getRevisionNode(id); if (!node.getId().isTxn()) { return; } if (node.getType() == SVNNodeKind.DIR) { Map entries = node.getDirEntries(getOwner()); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); deleteEntryIfMutable(entry.getId()); } } removeRevisionNode(id); }
private void deleteEntryIfMutable(FSID id) throws SVNException { FSRevisionNode node = getOwner().getRevisionNode(id); if (!node.getId().isTxn()) { return; } if (node.getType() == SVNNodeKind.DIR) { Map entries = node.getDirEntries(getOwner()); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); deleteEntryIfMutable(entry.getId()); } } removeRevisionNode(id); }
private void getTree(FSFS fsfs, FSRoot root, String path, SVNNodeKind kind, FSID id, boolean includeIDs, int depth, boolean recursive, ISVNTreeHandler handler) throws SVNException { checkCancelled(); if (handler != null) { handler.handlePath(new SVNAdminPath(path, includeIDs ? id.toString() : null, depth, kind == SVNNodeKind.DIR)); } if (kind != SVNNodeKind.DIR) { return; } if (recursive || depth == 0) { FSRevisionNode node = root.getRevisionNode(path); Map entries = node.getDirEntries(fsfs); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); getTree(fsfs, root, SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, recursive, handler); } } }
private void getTree(FSFS fsfs, FSRoot root, String path, SVNNodeKind kind, FSID id, boolean includeIDs, int depth, boolean recursive, ISVNTreeHandler handler) throws SVNException { checkCancelled(); if (handler != null) { handler.handlePath(new SVNAdminPath(path, includeIDs ? id.toString() : null, depth, kind == SVNNodeKind.DIR)); } if (kind != SVNNodeKind.DIR) { return; } if (recursive || depth == 0) { FSRevisionNode node = root.getRevisionNode(path); Map entries = node.getDirEntries(fsfs); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); getTree(fsfs, root, SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, recursive, handler); } } }
public FSRevisionNode getChildDirNode(String childName, FSFS fsfsOwner) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to open node with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = getDirEntries(fsfsOwner); FSEntry entry = entries != null ? (FSEntry) entries.get(childName) : null; if (entry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "Attempted to open non-existent child node ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } return fsfsOwner.getRevisionNode(entry.getId()); }
public FSRevisionNode getChildDirNode(String childName, FSFS fsfsOwner) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to open node with an illegal name ''{0}''", childName); SVNErrorManager.error(err); } Map entries = getDirEntries(fsfsOwner); FSEntry entry = entries != null ? (FSEntry) entries.get(childName) : null; if (entry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "Attempted to open non-existent child node ''{0}''", childName); SVNErrorManager.error(err); } return fsfsOwner.getRevisionNode(entry.getId()); }
private void getTree(FSFS fsfs, FSRoot root, String path, SVNNodeKind kind, FSID id, boolean includeIDs, int depth, boolean recursive, ISVNTreeHandler handler) throws SVNException { checkCancelled(); if (handler != null) { handler.handlePath(new SVNAdminPath(path, includeIDs ? id.toString() : null, depth, kind == SVNNodeKind.DIR)); } if (kind != SVNNodeKind.DIR) { return; } if (recursive || depth == 0) { FSRevisionNode node = root.getRevisionNode(path); Map entries = node.getDirEntries(fsfs); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); getTree(fsfs, root, SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, recursive, handler); } } }
public FSRevisionNode getChildDirNode(String childName, FSFS fsfsOwner) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to open node with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = getDirEntries(fsfsOwner); FSEntry entry = entries != null ? (FSEntry) entries.get(childName) : null; if (entry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "Attempted to open non-existent child node ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } return fsfsOwner.getRevisionNode(entry.getId()); }
public FSRevisionNode getChildDirNode(String childName, FSFS fsfsOwner) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to open node with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = getDirEntries(fsfsOwner); FSEntry entry = entries != null ? (FSEntry) entries.get(childName) : null; if (entry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "Attempted to open non-existent child node ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } return fsfsOwner.getRevisionNode(entry.getId()); }
public void deleteEntry(FSRevisionNode parent, String entryName) throws SVNException { if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to delete entry ''{0}'' from *non*-directory node", entryName); SVNErrorManager.error(err); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to delete entry ''{0}'' from immutable directory node", entryName); SVNErrorManager.error(err); } if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to delete a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err); } Map entries = parent.getDirEntries(getOwner()); FSEntry dirEntry = (FSEntry) entries.get(entryName); if (dirEntry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_ENTRY, "Delete failed--directory has no entry ''{0}''", entryName); SVNErrorManager.error(err); } getOwner().getRevisionNode(dirEntry.getId()); deleteEntryIfMutable(dirEntry.getId()); setEntry(parent, entryName, null, SVNNodeKind.UNKNOWN); }
public void deleteEntry(FSRevisionNode parent, String entryName) throws SVNException { if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to delete entry ''{0}'' from *non*-directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to delete entry ''{0}'' from immutable directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to delete a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = parent.getDirEntries(getOwner()); FSEntry dirEntry = (FSEntry) entries.get(entryName); if (dirEntry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_ENTRY, "Delete failed--directory has no entry ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } getOwner().getRevisionNode(dirEntry.getId()); deleteEntryIfMutable(dirEntry.getId()); setEntry(parent, entryName, null, SVNNodeKind.UNKNOWN); }
public void deleteEntry(FSRevisionNode parent, String entryName) throws SVNException { if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to delete entry ''{0}'' from *non*-directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to delete entry ''{0}'' from immutable directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to delete a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = parent.getDirEntries(getOwner()); FSEntry dirEntry = (FSEntry) entries.get(entryName); if (dirEntry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_ENTRY, "Delete failed--directory has no entry ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } getOwner().getRevisionNode(dirEntry.getId()); deleteEntryIfMutable(dirEntry.getId()); setEntry(parent, entryName, null, SVNNodeKind.UNKNOWN); }