Pattern.compile("[\\p{Cntrl}.!`\\]\\[]");
/** the File of the database */
- private final File _file;
+ private final Path _file;
/** the simple name of the database */
private final String _name;
+ /** whether or not this db is read-only */
+ private final boolean _readOnly;
/** Buffer to hold database pages */
private ByteBuffer _buffer;
/** ID of the Tables system object */
* @param charset Charset to use, if {@code null}, uses default
* @param timeZone TimeZone to use, if {@code null}, uses default
*/
- protected DatabaseImpl(File file, FileChannel channel, boolean closeChannel,
+ protected DatabaseImpl(Path file, FileChannel channel, boolean closeChannel,
boolean autoSync, FileFormat fileFormat, Charset charset,
- TimeZone timeZone, CodecProvider provider)
+ TimeZone timeZone, CodecProvider provider,
+ boolean readOnly)
throws IOException
{
_file = file;
* @return the temp db for holding the linked table info
*/
protected Database createTempDb(Object customFile, FileFormat format,
- boolean inMemory, Path tempDir)
- boolean inMemory, File tempDir,
++ boolean inMemory, Path tempDir,
+ boolean readOnly)
throws IOException
{
- File dbFile = null;
+ Path dbFile = null;
FileChannel channel = null;
boolean success = false;
try {
private final Object _customFile;
protected TempDatabaseImpl(CustomLinkResolver resolver, Object customFile,
- File file, FileChannel channel,
+ Path file, FileChannel channel,
- FileFormat fileFormat)
+ FileFormat fileFormat, boolean readOnly)
throws IOException
{
- super(file, channel, true, false, fileFormat, null, null, null);
+ super(file, channel, true, false, fileFormat, null, null, null,
+ readOnly);
_resolver = resolver;
_customFile = customFile;
}
@Override
protected Database createTempDb(Object customFile, FileFormat format,
- boolean inMemory, Path tempDir)
- boolean inMemory, File tempDir,
++ boolean inMemory, Path tempDir,
+ boolean readOnly)
throws IOException
{
inMemory = "testFile1.txt".equals(customFile);