Package sun.net.www.protocol.file

Examples of sun.net.www.protocol.file.FileURLConnection


    List<File> totalList = Arrays.asList(files);
    final List<File> list = new ArrayList<File>(totalList.size());
    for (File file : totalList){
      if (file.isFile() && file.canRead() && !file.isHidden() && file.length()>2 ){
        try {
          FileURLConnection conn = (FileURLConnection) file.toURI().toURL().openConnection();
          if (!json && conn.getContentType().endsWith("java-serialized-object")){
            list.add(file);
          }
          if (json && conn.getContentType().contains("json")){
            list.add(file);
          }
          conn.close();
        } catch (Exception e) {
          logger.warning("Couldn't check contentType of potential state file:"+file.getName());
        }
      }
    }
View Full Code Here

TOP

Related Classes of sun.net.www.protocol.file.FileURLConnection

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.