/** * Sets an attribute of this file. */ protected void doSetAttribute(final String atttrName, final Object value) throws Exception { file.getContent().setAttribute(atttrName, value); }
private Command createCommand(FileObject file) throws FileSystemException, CommandException { assert file != null; // HACK: Must dereference to avoid problems with the DelegateFileObject impl file = fileSystemAccess.dereference(file); log.trace("Creating command for file: {} ({})", file, file.getClass()); Command command = null; if (file.exists()) { FileContent content = file.getContent(); command = (Command)content.getAttribute("COMMAND"); if (command == null) { if (file.getType().hasChildren()) { command = createGroupCommand(file); content.setAttribute("COMMAND", command); } // TODO: Try to construct AliasCommand? } } if (command == null) { throw new CommandException("Unable to create command for file: " + file.getName()); } return command; }