/** * Creates this entry as a directory in the associated <code>AbstractArchiveFile</code>. * <p> * Throws a {@link UnsupportedFileOperationException} if if the underlying file does not support the required * read and write {@link FileOperation file operations}. Throws an <code>IOException</code> if this entry * already exists in the archive or if an I/O error occurred. * </p> * * @throws IOException if this entry already exists in the archive or if an I/O error occurred. * @throws UnsupportedFileOperationException if the underlying archive file does not support the required read and * write {@link FileOperation file operations}. */ @Override public void mkdir() throws IOException, UnsupportedFileOperationException { if(entry.exists()) throw new IOException(); AbstractRWArchiveFile rwArchivefile = (AbstractRWArchiveFile)archiveFile; // Update the ArchiveEntry entry.setDirectory(true); entry.setDate(System.currentTimeMillis()); entry.setSize(0); // Add the entry to the archive file rwArchivefile.addEntry(entry); // The entry now exists entry.setExists(true); }
OutputStream out = new CounterOutputStream(((AbstractRWArchiveFile)archiveFile).addEntry(entry), new ByteCounter() { @Override