de.schlichtherle.truezip.fs.FsReadOnlyArchiveFileSystem Maven / Gradle / Ivy
/*
* Copyright (C) 2005-2015 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package de.schlichtherle.truezip.fs;
import de.schlichtherle.truezip.entry.Entry;
import de.schlichtherle.truezip.entry.Entry.Access;
import de.schlichtherle.truezip.entry.Entry.Type;
import de.schlichtherle.truezip.entry.EntryContainer;
import de.schlichtherle.truezip.util.BitField;
import java.util.Map;
import javax.annotation.CheckForNull;
import javax.annotation.WillNotClose;
import javax.annotation.concurrent.NotThreadSafe;
/**
* A read-only virtual file system for archive entries.
*
* All modifying methods throw a {@link FsReadOnlyArchiveFileSystemException}.
*
* @param The type of the archive entries.
* @author Christian Schlichtherle
*/
@NotThreadSafe
final class FsReadOnlyArchiveFileSystem
extends FsArchiveFileSystem {
FsReadOnlyArchiveFileSystem(final @WillNotClose EntryContainer archive,
final FsArchiveDriver driver,
final @CheckForNull Entry rootTemplate)
throws FsArchiveFileSystemException {
super(driver, archive, rootTemplate);
}
/**
* Returns {@code true} to indicate that this archive file system is
* read-only.
*
* @return {@code true}
*/
@Override
boolean isReadOnly() {
return true;
}
@Override
FsArchiveFileSystemOperation mknod(
FsEntryName name,
Type type,
BitField options,
Entry template)
throws FsArchiveFileSystemException {
throw new FsReadOnlyArchiveFileSystemException();
}
@Override
void unlink(FsEntryName path)
throws FsArchiveFileSystemException {
throw new FsReadOnlyArchiveFileSystemException();
}
@Override
boolean setTime(FsEntryName path, BitField types, long value)
throws FsArchiveFileSystemException {
throw new FsReadOnlyArchiveFileSystemException();
}
@Override
boolean setTime(FsEntryName path, Map times)
throws FsArchiveFileSystemException {
throw new FsReadOnlyArchiveFileSystemException();
}
}