/** * Get an Iterator of objects, some of which may implement * POIFSViewable * * @return an Iterator; may not be null, but may have an empty * back end store */ public Iterator<Object> getViewableIterator() { List<Object> components = new ArrayList<>(); components.add(getProperty()); components.addAll(_entries); return components.iterator(); }
/** * Sets the storage clsid for the directory entry * * @param clsidStorage storage Class ID */ public void setStorageClsid(ClassID clsidStorage) { getProperty().setStorageClsid(clsidStorage); }
/** * Gets the storage clsid of the directory entry * * @return storage Class ID */ public ClassID getStorageClsid() { return getProperty().getStorageClsid(); }
/** * create a new DirectoryEntry * * @param name the name of the new DirectoryEntry * * @return the new DirectoryEntry * * @exception IOException if the directory can't be created */ public DirectoryEntry createDirectory(final String name) throws IOException { DirectoryProperty property = new DirectoryProperty(name); DirectoryNode rval = new DirectoryNode(property, _nfilesystem, this); _nfilesystem.addDirectory(property); (( DirectoryProperty ) getProperty()).addChild(property); _entries.add(rval); _byname.put(name, rval); return rval; }
/** * Change a contained Entry's name * * @param oldName the original name * @param newName the new name * * @return true if the operation succeeded, else false */ boolean changeName(final String oldName, final String newName) { boolean rval = false; EntryNode child = ( EntryNode ) _byname.get(oldName); if (child != null) { rval = (( DirectoryProperty ) getProperty()) .changeName(child.getProperty(), newName); if (rval) { _byname.remove(oldName); _byname.put(child.getProperty().getName(), child); } } return rval; }
/** * Delete an entry * * @param entry the EntryNode to be deleted * * @return true if the entry was deleted, else false */ boolean deleteEntry(final EntryNode entry) { boolean rval = (( DirectoryProperty ) getProperty()) .deleteChild(entry.getProperty()); if (rval) { _entries.remove(entry); _byname.remove(entry.getName()); try { _nfilesystem.remove(entry); } catch (IOException e) { // TODO Work out how to report this, given we can't change the method signature... throw new RuntimeException(e); } } return rval; }
/** * create a new DocumentEntry * * @param document the new document * * @return the new DocumentEntry * * @exception IOException if the document can't be created */ DocumentEntry createDocument(final POIFSDocument document) throws IOException { DocumentProperty property = document.getDocumentProperty(); DocumentNode rval = new DocumentNode(property, this); (( DirectoryProperty ) getProperty()).addChild(property); _nfilesystem.addDocument(document); _entries.add(rval); _byname.put(property.getName(), rval); return rval; }
/** * Get an Iterator of objects, some of which may implement * POIFSViewable * * @return an Iterator; may not be null, but may have an empty * back end store */ public Iterator<Object> getViewableIterator() { List<Object> components = new ArrayList<>(); components.add(getProperty()); components.addAll(_entries); return components.iterator(); }
/** * Sets the storage clsid for the directory entry * * @param clsidStorage storage Class ID */ public void setStorageClsid(ClassID clsidStorage) { getProperty().setStorageClsid(clsidStorage); }
/** * Sets the storage clsid for the directory entry * * @param clsidStorage storage Class ID */ public void setStorageClsid(ClassID clsidStorage) { getProperty().setStorageClsid(clsidStorage); }
/** * Gets the storage clsid of the directory entry * * @return storage Class ID */ public ClassID getStorageClsid() { return getProperty().getStorageClsid(); }
/** * Gets the storage clsid of the directory entry * * @return storage Class ID */ public ClassID getStorageClsid() { return getProperty().getStorageClsid(); }
/** * Gets the storage clsid of the directory entry * * @return storage Class ID */ public ClassID getStorageClsid() { return getProperty().getStorageClsid(); }
/** * Sets the storage clsid for the directory entry * * @param clsidStorage storage Class ID */ public void setStorageClsid(ClassID clsidStorage) { getProperty().setStorageClsid(clsidStorage); }
/** * Get an Iterator of objects, some of which may implement * POIFSViewable * * @return an Iterator; may not be null, but may have an empty * back end store */ @SuppressWarnings("unchecked") public Iterator getViewableIterator() { List components = new ArrayList(); components.add(getProperty()); Iterator<Entry> iter = _entries.iterator(); while (iter.hasNext()) { components.add(iter.next()); } return components.iterator(); }
/** * Get an Iterator of objects, some of which may implement * POIFSViewable * * @return an Iterator; may not be null, but may have an empty * back end store */ @SuppressWarnings("unchecked") public Iterator getViewableIterator() { List components = new ArrayList(); components.add(getProperty()); Iterator<Entry> iter = _entries.iterator(); while (iter.hasNext()) { components.add(iter.next()); } return components.iterator(); }
/** * create a new DirectoryEntry * * @param name the name of the new DirectoryEntry * * @return the new DirectoryEntry * * @exception IOException if the directory can't be created */ public DirectoryEntry createDirectory(final String name) throws IOException { DirectoryProperty property = new DirectoryProperty(name); DirectoryNode rval = new DirectoryNode(property, _nfilesystem, this); _nfilesystem.addDirectory(property); (( DirectoryProperty ) getProperty()).addChild(property); _entries.add(rval); _byname.put(name, rval); return rval; }
/** * create a new DocumentEntry * * @param document the new document * * @return the new DocumentEntry * * @exception IOException */ DocumentEntry createDocument(final POIFSDocument document) throws IOException { DocumentProperty property = document.getDocumentProperty(); DocumentNode rval = new DocumentNode(property, this); (( DirectoryProperty ) getProperty()).addChild(property); _ofilesystem.addDocument(document); _entries.add(rval); _byname.put(property.getName(), rval); return rval; }
/** * create a new DocumentEntry * * @param document the new document * * @return the new DocumentEntry * * @exception IOException if the document can't be created */ DocumentEntry createDocument(final POIFSDocument document) throws IOException { DocumentProperty property = document.getDocumentProperty(); DocumentNode rval = new DocumentNode(property, this); (( DirectoryProperty ) getProperty()).addChild(property); _nfilesystem.addDocument(document); _entries.add(rval); _byname.put(property.getName(), rval); return rval; }
/** * create a new DocumentEntry * * @param document the new document * * @return the new DocumentEntry * * @exception IOException */ DocumentEntry createDocument(final POIFSDocument document) throws IOException { DocumentProperty property = document.getDocumentProperty(); DocumentNode rval = new DocumentNode(property, this); (( DirectoryProperty ) getProperty()).addChild(property); _ofilesystem.addDocument(document); _entries.add(rval); _byname.put(property.getName(), rval); return rval; }