attributesHandler = new AttributesHandler(this); attrs = attributesHandler.getAttributes(); return attrs; } catch (IOException e) {
AttributesNode attributesNode = attributesNode( treeWalk, workingTreeIterator, dirCacheIterator, otherTree); if (attributesNode != null) { mergeAttributes(attributesNode, entryPath.substring(nameRoot + 1), isDirectory, result); mergePerDirectoryEntryAttributes(entryPath, entryPath.lastIndexOf('/', nameRoot - 1), isDirectory, parentOf(workingTreeIterator), parentOf(dirCacheIterator), parentOf(otherTree), result);
expandMacro(attributeIte.previous(), result);
? attributesNodeProvider.getInfoAttributesNode() : null; AttributesNode rootNode = attributesNode(treeWalk, rootOf( treeWalk.getTree(WorkingTreeIterator.class)), rootOf( treeWalk.getTree(DirCacheIterator.class)), rootOf(treeWalk .getTree(CanonicalTreeParser.class)));
mergeInfoAttributes(entryPath, isDirectory, attributes); mergePerDirectoryEntryAttributes(entryPath, entryPath.lastIndexOf('/'), isDirectory, treeWalk.getTree(WorkingTreeIterator.class), mergeGlobalAttributes(entryPath, isDirectory, attributes);
/** * Merges the matching GLOBAL attributes for an entry path. * * @param entryPath * the path to test. The path must be relative to this attribute * node's own repository path, and in repository path format * (uses '/' and not '\'). * @param isDirectory * true if the target item is a directory. * @param result * that will hold the attributes matching this entry path. This * method will NOT override any existing entry in attributes. */ private void mergeGlobalAttributes(String entryPath, boolean isDirectory, Attributes result) { mergeAttributes(globalNode, entryPath, isDirectory, result); }
/** * see {@link TreeWalk#getAttributes()} * * @return the {@link Attributes} for the current path represented by the * {@link TreeWalk} * @throws IOException */ public Attributes getAttributes() throws IOException { String entryPath = treeWalk.getPathString(); boolean isDirectory = (treeWalk.getFileMode() == FileMode.TREE); Attributes attributes = new Attributes(); // Gets the info attributes mergeInfoAttributes(entryPath, isDirectory, attributes); // Gets the attributes located on the current entry path mergePerDirectoryEntryAttributes(entryPath, isDirectory, treeWalk.getTree(WorkingTreeIterator.class), treeWalk.getTree(DirCacheIterator.class), treeWalk.getTree(CanonicalTreeParser.class), attributes); // Gets the attributes located in the global attribute file mergeGlobalAttributes(entryPath, isDirectory, attributes); // now after all attributes are collected - in the correct hierarchy // order - remove all unspecified entries (the ! marker) for (Attribute a : attributes.getAll()) { if (a.getState() == State.UNSPECIFIED) attributes.remove(a.getKey()); } return attributes; }
? attributesNodeProvider.getInfoAttributesNode() : null; AttributesNode rootNode = attributesNode(treeWalk, rootOf( treeWalk.getTree(WorkingTreeIterator.class)), rootOf( treeWalk.getTree(DirCacheIterator.class)), rootOf(treeWalk .getTree(CanonicalTreeParser.class)));
/** * Merges the matching INFO attributes for an entry path. * * @param entryPath * the path to test. The path must be relative to this attribute * node's own repository path, and in repository path format * (uses '/' and not '\'). * @param isDirectory * true if the target item is a directory. * @param result * that will hold the attributes matching this entry path. This * method will NOT override any existing entry in attributes. */ private void mergeInfoAttributes(String entryPath, boolean isDirectory, Attributes result) { mergeAttributes(infoNode, entryPath, isDirectory, result); }
AttributesNode attributesNode = attributesNode( treeWalk, workingTreeIterator, dirCacheIterator, otherTree); if (attributesNode != null) { mergeAttributes(attributesNode, entryPath, isDirectory, result); mergePerDirectoryEntryAttributes(entryPath, isDirectory, parentOf(workingTreeIterator), parentOf(dirCacheIterator), parentOf(otherTree), result);
mergeInfoAttributes(entryPath, isDirectory, attributes); mergePerDirectoryEntryAttributes(entryPath, entryPath.lastIndexOf('/'), isDirectory, treeWalk.getTree(WorkingTreeIterator.class), mergeGlobalAttributes(entryPath, isDirectory, attributes);
? attributesNodeProvider.getInfoAttributesNode() : null; AttributesNode rootNode = attributesNode(treeWalk, rootOf( treeWalk.getTree(WorkingTreeIterator.class)), rootOf( treeWalk.getTree(DirCacheIterator.class)), rootOf(treeWalk .getTree(CanonicalTreeParser.class)));
attributesHandler = new AttributesHandler(this); attrs = attributesHandler.getAttributes(); return attrs; } catch (IOException e) {
/** * Merges the matching GLOBAL attributes for an entry path. * * @param entryPath * the path to test. The path must be relative to this attribute * node's own repository path, and in repository path format * (uses '/' and not '\'). * @param isDirectory * true if the target item is a directory. * @param result * that will hold the attributes matching this entry path. This * method will NOT override any existing entry in attributes. */ private void mergeGlobalAttributes(String entryPath, boolean isDirectory, Attributes result) { mergeAttributes(globalNode, entryPath, isDirectory, result); }
switch (e.getState()) { case SET: expandMacro(new Attribute(e.getKey(), State.UNSET), result); break; case UNSET: expandMacro(new Attribute(e.getKey(), State.SET), result); break; case UNSPECIFIED: expandMacro(new Attribute(e.getKey(), State.UNSPECIFIED), result); break; case CUSTOM: default: expandMacro(e, result); case UNSET: case UNSPECIFIED: expandMacro(e, result); break; case CUSTOM: default: expandMacro(new Attribute(e.getKey(), attr.getValue()), result); expandMacro(new Attribute(e.getKey(), State.UNSPECIFIED), result); default: for (Attribute e : expansion) {
AttributesNode attributesNode = attributesNode( treeWalk, workingTreeIterator, dirCacheIterator, otherTree); if (attributesNode != null) { mergeAttributes(attributesNode, entryPath.substring(nameRoot + 1), isDirectory, result); mergePerDirectoryEntryAttributes(entryPath, entryPath.lastIndexOf('/', nameRoot - 1), isDirectory, parentOf(workingTreeIterator), parentOf(dirCacheIterator), parentOf(otherTree), result);
attributesHandler = new AttributesHandler(this); attrs = attributesHandler.getAttributes(); return attrs; } catch (IOException e) {
/** * Merges the matching INFO attributes for an entry path. * * @param entryPath * the path to test. The path must be relative to this attribute * node's own repository path, and in repository path format * (uses '/' and not '\'). * @param isDirectory * true if the target item is a directory. * @param result * that will hold the attributes matching this entry path. This * method will NOT override any existing entry in attributes. */ private void mergeInfoAttributes(String entryPath, boolean isDirectory, Attributes result) { mergeAttributes(infoNode, entryPath, isDirectory, result); }
expandMacro(attributeIte.previous(), result);
/** * Merges the matching GLOBAL attributes for an entry path. * * @param entryPath * the path to test. The path must be relative to this attribute * node's own repository path, and in repository path format * (uses '/' and not '\'). * @param isDirectory * true if the target item is a directory. * @param result * that will hold the attributes matching this entry path. This * method will NOT override any existing entry in attributes. */ private void mergeGlobalAttributes(String entryPath, boolean isDirectory, Attributes result) { mergeAttributes(globalNode, entryPath, isDirectory, result); }