Examples of FileStore


Examples of org.h2.store.FileStore

    public InputStream getInputStream() {
        if (small != null) {
            return new ByteArrayInputStream(small);
        } else if (fileName != null) {
            FileStore store = handler.openFile(fileName, "r", true);
            boolean alwaysClose = SysProperties.lobCloseBetweenReads;
            return new BufferedInputStream(new FileStoreInputStream(store, handler, false, alwaysClose),
                    Constants.IO_BUFFER_SIZE);
        }
        long byteCount = (type == Value.BLOB) ? precision : -1;
View Full Code Here

Examples of org.jitterbit.application.filestore.FileStore

        updateLatestFile(file);
    }

    private void addNewFileToFileStore(File file) {
        try {
            FileStore files = delegate.getFiles();
            String path = delegate.getRootPath() + File.separator + file.getName();
            if (isFileFromFileStore(file, path)) {
                return;
            }
            FileCollisionResolver cr = FileCollisionResolver.REPLACE_EXISTING;
            if (ZipUtils.isLikelyZipped(file)) {
                files.addFile(file, path, cr);
            } else {
                byte[] compressedFile = ZipUtils.deflateFileContents(file);
                files.addFile(path, compressedFile, cr);
            }
        } catch (IOException e) {
            logStoreFileFailed(e);
        } catch (FileStoreException e) {
            logStoreFileFailed(e);
View Full Code Here

Examples of org.lealone.store.FileStore

    @Override
    public FileStore openFile(String name, String openMode, boolean mustExist) {
        if (mustExist && !FileUtils.exists(name)) {
            throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, name);
        }
        FileStore store = FileStore.open(this, name, openMode, cipher, filePasswordHash);
        try {
            store.init();
        } catch (DbException e) {
            store.closeSilently();
            throw e;
        }
        return store;
    }
View Full Code Here

Examples of org.lealone.store.FileStore

    public InputStream getInputStream() {
        if (fileName == null) {
            return new ByteArrayInputStream(small);
        }
        FileStore store = handler.openFile(fileName, "r", true);
        boolean alwaysClose = SysProperties.lobCloseBetweenReads;
        return new BufferedInputStream(new FileStoreInputStream(store, handler, compression, alwaysClose),
                Constants.IO_BUFFER_SIZE);
    }
View Full Code Here

Examples of org.lealone.store.FileStore

    @Override
    public FileStore openFile(String name, String mode, boolean mustExist) {
        if (mustExist && !FileUtils.exists(name)) {
            throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, name);
        }
        FileStore store;
        if (cipher == null) {
            store = FileStore.open(this, name, mode);
        } else {
            store = FileStore.open(this, name, mode, cipher, fileEncryptionKey, 0);
        }
        store.setCheckedWriting(false);
        try {
            store.init();
        } catch (DbException e) {
            store.closeSilently();
            throw e;
        }
        return store;
    }
View Full Code Here

Examples of org.lealone.store.FileStore

    public InputStream getInputStream() {
        if (small != null) {
            return new ByteArrayInputStream(small);
        } else if (fileName != null) {
            FileStore store = handler.openFile(fileName, "r", true);
            boolean alwaysClose = SysProperties.lobCloseBetweenReads;
            return new BufferedInputStream(new FileStoreInputStream(store, handler, false, alwaysClose), Constants.IO_BUFFER_SIZE);
        }
        long byteCount = (type == Value.BLOB) ? precision : -1;
        try {
View Full Code Here

Examples of org.papoose.store.file.FileStore

        else
        {
            String storageString = properties.getProperty(Constants.FRAMEWORK_STORAGE, ".");

            File file = new File(storageString).getAbsoluteFile();
            store = new FileStore(file);

            if (!"FILE".equals(storeTypeString))
            {
                LOGGER.warning("Unable to parse " + PapooseConstants.PAPOOSE_FRAMEWORK_STORE_TYPE + ", using file store");
            }
View Full Code Here

Examples of org.teiid.common.buffer.FileStore

      this.textLine = textLine;           
  }

  private FileStoreInputStreamFactory buildResult() throws TeiidProcessingException {
    try {
      FileStore fs = context.getBufferManager().createFileStore("textagg"); //$NON-NLS-1$
      FileStoreInputStreamFactory fisf = new FileStoreInputStreamFactory(fs, textLine.getEncoding()==null?Streamable.ENCODING:textLine.getEncoding());
      Writer w = fisf.getWriter();
      if (textLine.isIncludeHeader()) {
        w.write(TextLine.evaluate(textLine.getExpressions(), new TextLine.ValueExtractor<DerivedColumn>() {
          public Object getValue(DerivedColumn t) {
View Full Code Here

Examples of org.teiid.common.buffer.FileStore

   * Documents less than the maxMemorySize will be held directly in memory
   */
  public static SQLXMLImpl saveToBufferManager(BufferManager bufferMgr, XMLTranslator translator)
      throws TeiidComponentException, TeiidProcessingException {       
      boolean success = false;
      final FileStore lobBuffer = bufferMgr.createFileStore("xml"); //$NON-NLS-1$
      FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(lobBuffer, Streamable.ENCODING);
      try
        Writer writer = fsisf.getWriter();
          translator.translate(writer);
          writer.close();
          success = true;
          return new SQLXMLImpl(fsisf);
      } catch(IOException e) {
          throw new TeiidComponentException(e);
      } catch(TransformerException e) {
          throw new TeiidProcessingException(e);
      } finally {
        if (!success && lobBuffer != null) {
          lobBuffer.remove();
        }
      }
  }
View Full Code Here

Examples of org.teiid.common.buffer.FileStore

  }
   
    @Test public void testWrite() throws Exception {
        FileStorageManager sm = getStorageManager(null, null, null);       
        String tsID = "0";     //$NON-NLS-1$
        FileStore store = sm.createFileStore(tsID);
        writeBytes(store);
        assertEquals(2048, sm.getUsedBufferSpace());
        store.remove();
        assertEquals(0, sm.getUsedBufferSpace());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.