Package ch.entwine.weblounge.common.impl.request

Examples of ch.entwine.weblounge.common.impl.request.Resource


   * @see javax.servlet.ServletContext#getResourcePaths(java.lang.String)
   */
  @SuppressWarnings({ "rawtypes", "unchecked" })
  public Set getResourcePaths(String path) {
    String actualPath = (path.endsWith("/") ? path : path + "/");
    Resource resource = this.resourceLoader.getResource(getResourceLocation(actualPath));
    try {
      File file = resource.getFile();
      String[] fileList = file.list();
      if (fileList == null || fileList.length == 0) {
        return null;
      }
      Set resourcePaths = new LinkedHashSet(fileList.length);
View Full Code Here


   * {@inheritDoc}
   *
   * @see javax.servlet.ServletContext#getResource(java.lang.String)
   */
  public URL getResource(String path) throws MalformedURLException {
    Resource resource = this.resourceLoader.getResource(getResourceLocation(path));
    if (!resource.exists()) {
      return null;
    }
    try {
      return resource.getURL();
    } catch (MalformedURLException e) {
      throw e;
    } catch (IOException e) {
      logger.warn("Could not get URL for " + resource, e);
      return null;
View Full Code Here

   * {@inheritDoc}
   *
   * @see javax.servlet.ServletContext#getResourceAsStream(java.lang.String)
   */
  public InputStream getResourceAsStream(String path) {
    Resource resource = this.resourceLoader.getResource(getResourceLocation(path));
    if (!resource.exists()) {
      return null;
    }
    try {
      return resource.getInputStream();
    } catch (IOException e) {
      logger.warn("Could not open InputStream for " + resource, e);
      return null;
    }
  }
View Full Code Here

   * {@inheritDoc}
   *
   * @see javax.servlet.ServletContext#getRealPath(java.lang.String)
   */
  public String getRealPath(String path) {
    Resource resource = this.resourceLoader.getResource(getResourceLocation(path));
    try {
      return resource.getFile().getAbsolutePath();
    } catch (IOException e) {
      logger.warn("Could not determine real path of resource " + resource, e);
      return null;
    }
  }
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.impl.request.Resource

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.