Package com.planet_ink.coffee_web.interfaces

Examples of com.planet_ink.coffee_web.interfaces.FileManager


    String host=request.getHost();
    final int x=host.indexOf(':');
    if(x>0) host=host.substring(0, x); // we only care about the host, we KNOW the port.
    final Pair<String,String> newPath=config.getMount(host,request.getClientPort(),fullPathStr);
    File finalFile;
    final FileManager mgr=config.getFileManager();
    if(newPath == null)
      finalFile = mgr.createFileFromPath(fullPathStr.replace('/', mgr.getFileSeparator()));
    else
    {
      String newFullPath=fullPathStr.substring(newPath.first.length());
      if(newFullPath.startsWith("/")&&newPath.second.endsWith("/"))
        newFullPath=newFullPath.substring(1);
      finalFile=mgr.createFileFromPath((newPath.second+newFullPath).replace('/', mgr.getFileSeparator())); // subtract one for the /
    }
    // see if the path we have is complete, or if there's an implicit default page requested.
    if(request.getUrlPath().endsWith("/"))
    {
      final File dirFile = finalFile;
      finalFile=mgr.createFileFromPath(finalFile,config.getDefaultPage());
      if((!finalFile.exists())&&(dirFile.exists())&&(dirFile.isDirectory()))
      {
        String browseCode = config.getBrowseCode(host,request.getClientPort(),fullPathStr);
        if(browseCode != null) // it's allowed to be browsed
          finalFile = dirFile;
View Full Code Here


        return null;
      }

      final char[] passphrase = config.getSslKeystorePassword().toCharArray();
      final KeyStore keyStore = KeyStore.getInstance(config.getSslKeystoreType());
      final FileManager mgr=config.getFileManager();
      keyStore.load(mgr.getFileStream(mgr.createFileFromPath(config.getSslKeystorePath())), passphrase);
 
      final KeyManagerFactory kmf = KeyManagerFactory.getInstance(config.getSslKeyManagerEncoding());
      kmf.init(keyStore, passphrase);
 
      final TrustManagerFactory tmf = TrustManagerFactory.getInstance(config.getSslKeyManagerEncoding());
View Full Code Here

TOP

Related Classes of com.planet_ink.coffee_web.interfaces.FileManager

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.