Package org.tmatesoft.sqljet.core

Examples of org.tmatesoft.sqljet.core.SqlJetIOException


        }

        if (filePath != null && permissions.contains(SqlJetFileOpenPermission.DELETEONCLOSE)) {
            if (!SqlJetFileUtil.deleteFile(filePath)) {
                throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_DELETE, String.format("Can't delete file '%s'",
                        filePath.getPath()));
            }
        }

        OSTRACE("CLOSE   %s\n", this.filePath);
View Full Code Here


            final int read = buffer.readFromFile(file, offset, amount);
            TIMER_END();
            OSTRACE("READ %s %5d %7d %d\n", this.filePath, read, offset, TIMER_ELAPSED());
            return read < 0 ? 0 : read;
        } catch (IOException e) {
            throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_READ, e);
        }
    }
View Full Code Here

            TIMER_START();
            final int write = buffer.writeToFile(file, offset, amount);
            TIMER_END();
            OSTRACE("WRITE %s %5d %7d %d\n", this.filePath, write, offset, TIMER_ELAPSED());
        } catch (IOException e) {
            throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_WRITE, e);
        }
    }
View Full Code Here

        assert (size >= 0);
        assert (file != null);
        try {
            file.setLength(size);
        } catch (IOException e) {
            throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_TRUNCATE, e);
        }
    }
View Full Code Here

        try {
            OSTRACE("SYNC    %s\n", this.filePath);
            boolean syncMetaData = syncFlags != null && syncFlags.contains(SqlJetSyncFlags.NORMAL);
            file.getChannel().force(syncMetaData);
        } catch (IOException e) {
            throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_FSYNC, e);
        }
    }
View Full Code Here

                return true;

            }

        } catch (IOException e) {
            throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_LOCK, e);
        } finally {
            OSTRACE("LOCK    %s %s %s\n", this.filePath, locktypeName(lockType), this.lockType == lockType ? "ok"
                    : "failed");

        }
View Full Code Here

                }
                this.lockType = lockType;

            } catch (IOException e) {
                throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_LOCK, e);
            }
        }

        return true;
    }
View Full Code Here

    public String getFullPath(File filename) throws SqlJetException {
        assert (filename != null);
        try {
            return filename.getCanonicalPath();
        } catch (IOException e) {
            throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_ACCESS, e);
        }
    }
View Full Code Here

     */
    private void readDbPage(final ISqlJetPage page, int pageNumber) throws SqlJetIOException {
        assert (!memDb);
        assert (null != fd || tempFile);
        if (null == fd) {
            throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_SHORT_READ);
        }
        long offset = (pageNumber - 1) * pageSize;
        final ISqlJetMemoryPointer data = page.getData();
        fd.read(data, pageSize, offset);
        if (1 == pageNumber) {
View Full Code Here

                }
                journalOpen = false;
                if (rc == null && !tempFile) {
                    try {
                        if (!fileSystem.delete(journal, true)) {
                            rc = new SqlJetIOException(SqlJetIOErrorCode.IOERR_DELETE);
                        }
                    } catch (SqlJetException e) {
                        rc = e;
                    }
                }
View Full Code Here

TOP

Related Classes of org.tmatesoft.sqljet.core.SqlJetIOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.