Package de.schlichtherle.io

Examples of de.schlichtherle.io.FileInputStream


        }
        return false;
    }
   
    public static byte[] readFile(File file) throws IOException {
        InputStream in = new FileInputStream(file);
        try {
            return IOUtils.toByteArray(in);
        } finally {
            in.close();
        }
    }
View Full Code Here


        }
    }

    protected void processFile(File aFile) throws Exception {
        String name = aFile.getCanonicalPath();
        InputStream in = new BufferedInputStream(new FileInputStream(aFile));
        InOnly exchange = getExchangeFactory().createInOnlyExchange();
        configureExchangeTarget(exchange);
        NormalizedMessage message = exchange.createMessage();
        exchange.setInMessage(message);
        marshaler.readMessage(exchange, message, in, name);
View Full Code Here

            response.setContentType(contentType);
            response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + "\"");
            InputStream in = null;
            ServletOutputStream out = null;
            try {
                in = new FileInputStream(downloadFile);
                out = response.getOutputStream();
                byte[] buffer = new byte[4096];
                int length;
                while ((length = in.read(buffer)) != -1) {
                    out.write(buffer, 0, length);
View Full Code Here

  }

  private void load() {
    ObjectInputStream ois = null;
    try {
          ois = new ObjectInputStream(new FileInputStream(_cachePath+"/"+LOCAL_ASSO_FILE_NAME)); //$NON-NLS-1$
      _associations = (Map) ois.readObject();
      for (Iterator iter = _associations.values().iterator(); iter.hasNext();) {
        ModuleInfoImpl mi = (ModuleInfoImpl) iter.next();
        mi.setVisibility(Visibility.PUBLIC);
      }
View Full Code Here

            File file = new File(fileIO.getCanonicalPath());
            if(file.exists()) {
                InputStream is = null;
                try {
                    StringBuffer buffer = new StringBuffer();
                    is =  new FileInputStream(file);
                    byte[] bytes = new byte[1024*5];
                    int readed = 0;
                    while((readed = is.read(bytes))>0) {
                        buffer.append(new String(bytes, 0, readed));
                    }
View Full Code Here

                                        throws IOException, InvalidPasswordException {
        // Note that if this method is called, the password is guaranteed to be correct
        // (otherwise we would have failed earlier on).
        ArchiveDetector detector = getArchiveDetector(password);
        File file = new File(folder, fileToExtract, detector);
        return new FileInputStream(file);
    }
View Full Code Here

                                        throws IOException, InvalidPasswordException {
        // Note that if this method is called, the password is  guaranteed to be correct
        // (otherwise we would have failed earlier on).
        ArchiveDetector detector = getArchiveDetector(password);
        File file = new File(inputFile, detector);
        return new FileInputStream(file);
    }
View Full Code Here

TOP

Related Classes of de.schlichtherle.io.FileInputStream

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.