Package de.schlichtherle.io

Examples of de.schlichtherle.io.File


     * Sets the file to poll, which can be a directory or a file.
     *
     * @param file
     */
    public void setFile(java.io.File file) {
        this.file = new File(file);
    }
View Full Code Here


        Map map = URISupport.parseQuery(uri.getQuery());
        if (IntrospectionSupport.setProperties(fileEp, map, "truezip.")) {
            uri = URISupport.createRemainingURI(uri, map);
        }
        if (file != null) {
            fileEp.setDirectory(new File(file));
        } else {
            throw new IllegalArgumentException("No file defined for URL: " + uri);
        }
        fileEp.activate();
        return fileEp;
View Full Code Here

    protected void processInOnly(MessageExchange exchange, NormalizedMessage in) throws Exception {
        OutputStream out = null;
        try {
            String name = marshaler.getOutputName(exchange, in);
            File newFile = null;
            if (name == null) {
                newFile = new File(directory, getNewTempName());
            } else {
                newFile = new File(directory, name);
            }
            if (logger.isDebugEnabled()) {
                logger.debug("Writing to file: " + newFile.getCanonicalPath());
            }
            out = new BufferedOutputStream(new FileOutputStream(newFile));
            marshaler.writeMessage(exchange, in, out, name);
        } finally {
            if (out != null) {
View Full Code Here

    public java.io.File getDirectory() {
        return directory;
    }

    public void setDirectory(java.io.File directory) {
        this.directory = new File(directory);
    }
View Full Code Here

  static IDataSource testFilter = new UserDefinedFilter("stepdone:5");
  private static String tempPath;

  @BeforeClass
  public static void setUp() {
    File f = new File("pages/imagesTemp");
    tempPath = f.getAbsolutePath() + File.separator;

    testManager = new StatisticsManager(StatisticsMode.THROUGHPUT, testFilter, locale);
    testManager2 = new StatisticsManager(StatisticsMode.PRODUCTION, testFilter, locale);

    Calendar cal1 = Calendar.getInstance();
View Full Code Here

    testManager.setTargetResultOutput(targetResultOutput);
  }

  @AfterClass
  public static void tearDown() {
    File dir = new File(tempPath);
    FilenameFilter filter = new FilenameFilter() {
      public boolean accept(java.io.File dir, String name) {
        return (name.toLowerCase().endsWith(".png") || name.toLowerCase().endsWith(".jpg"));
      }
    }
    String[] data = dir.list(filter);
    File file;
    if (data == null || data.length == 0) {
      return;
    }
      for (int i = 0; i < data.length; i++) {
        file = new File(tempPath + data[i]);
        boolean success = file.delete();
        if (!success) {
          throw new IllegalArgumentException("Delete: deletion failed");
        }
      }     
  }
View Full Code Here

  private StatisticsRenderingElement testElement = new StatisticsRenderingElement(inDataTable, inQuestion);
  private static String tempPath;

  @BeforeClass
  public static void setUp() {
    File f = new File("pages/imagesTemp");
    tempPath = f.getAbsolutePath() + File.pathSeparator;
  }
View Full Code Here

   
    public String getSource(String md5, String className) {
        java.io.File fileIO = getSourceFile(md5,  className);
        if(fileIO != null && (fileIO.length() != 0)){
          try{
            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];
 
View Full Code Here

    public void putSource(String md5, String className, String source) {
        OutputStream os = null;
        try {
            String zipName = getZipName(md5);
      String fullPath = zipName+"/"+getSourcePath(className); //$NON-NLS-1$
            File file = new File(fullPath);
            if(!file.exists() || (file.length() == 0)) {
                os = new FileOutputStream(fullPath);
                os.write(source.getBytes());
            }
        } catch (Exception e) {
          LOGGER.error("Unable to store class in cache.",e); //$NON-NLS-1$
View Full Code Here

            } catch (ZipControllerException e) {}
        }
    }
   
    public void doCleanup() {
        File file = new File(_cachePath);
        java.io.File[] zips = file.listFiles(new FilenameFilter() {
            public boolean accept(java.io.File dir, String name) {
                return name.endsWith(".zip"); //$NON-NLS-1$
            }
        });
        if(zips != null) {
          for (int i = 0; i < zips.length; i++) {
            zips[i].delete();
          }
        }
        file.delete();
    }
View Full Code Here

TOP

Related Classes of de.schlichtherle.io.File

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.