/** * Return the state. * * @param key * key of an attribute * @return the state (never returns <code>null</code>) */ public Attribute.State getState(String key) { Attribute a = map.get(key); return a != null ? a.getState() : Attribute.State.UNSPECIFIED; }
if (a.getState() == State.UNSPECIFIED) attributes.remove(a.getKey());
/** * Return the state. * * @param key * key of an attribute * @return the state (never returns <code>null</code>) */ public Attribute.State getState(String key) { Attribute a = map.get(key); return a != null ? a.getState() : Attribute.State.UNSPECIFIED; }
/** * Returns the state. * * @param key * * @return the state (never returns <code>null</code>) */ public Attribute.State getState(String key) { Attribute a = map.get(key); return a != null ? a.getState() : Attribute.State.UNSPECIFIED; }
if (a.getState() == State.UNSPECIFIED) attributes.remove(a.getKey());
/** * 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; }