Package com.codingcrayons.aspectfaces.exceptions

Examples of com.codingcrayons.aspectfaces.exceptions.TemplateFileNotFoundException


          } else {
            // read as resource
            tagContent = getServletResourceAsString(filePath);
          }
          if (tagContent == null) {
            throw new TemplateFileNotFoundException("File " + filePath + " not found.");
          }
          // add to cache
          StringBuilder tagContentStringBuilder = new StringBuilder(tagContent);

          ResourceCache.getInstance().putTemplate(cacheKey, tagContentStringBuilder);
          // keep the method here in case we disable cache
          return tagContentStringBuilder;
        } catch (TemplateFileAccessException e) {
          throw new TemplateFileNotFoundException("File " + filePath + " not found.", e);
        } catch (AFFileNotFoundException e) {
          throw new TemplateFileNotFoundException("File " + filePath + " not found.", e);
        }
      }
      return ResourceCache.getInstance().getTemplate(cacheKey);
    } else {
      return null;
View Full Code Here


    try {
      File file = new File(path);
      FileInputStream is = new FileInputStream(file);
      return readInputStream(is);
    } catch (NullPointerException e) {
      throw new TemplateFileNotFoundException(path + " file not found.", e);
    } catch (FileNotFoundException e) {
      throw new TemplateFileNotFoundException(path + " file not found.", e);
    } catch (Exception e) {
      throw new TemplateFileAccessException("Problem with " + path + " file.", e);
    }
  }
View Full Code Here

          ResourceCache.getInstance().putTemplate(cacheKey, tagContentStringBuilder);
          // keep the method here in case we disable cache
          return tagContentStringBuilder;
        } catch (TemplateFileAccessException e) {
          throw new TemplateFileNotFoundException("File " + filePath + " not found.", e);
        }
      }
      return ResourceCache.getInstance().getTemplate(cacheKey);
    } else {
      return null;
View Full Code Here

    this.galleryDirectory = galleryDirectory;
  }

  public String getHeaderFile() throws TemplateFileNotFoundException {
    if (Strings.isBlank(headerFile)) {
      throw new TemplateFileNotFoundException("Header template file not set.");
    }
    return headerFile;
  }
View Full Code Here

    this.headerFile = headerFile;
  }

  public String getFooterFile() throws TemplateFileNotFoundException {
    if (Strings.isBlank(footerFile)) {
      throw new TemplateFileNotFoundException("Footer template file not set.");
    }
    return footerFile;
  }
View Full Code Here

TOP

Related Classes of com.codingcrayons.aspectfaces.exceptions.TemplateFileNotFoundException

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.