Examples of ResourceNotFoundException


Examples of org.apache.velocity.exception.ResourceNotFoundException

  @Override
  public InputStream getResourceAsStream(String name) {
    byte[] b = findPluginResource(name);
    if (b == null) {
      throw new ResourceNotFoundException(name);
    }
    return new ByteArrayInputStream(b);
  }
View Full Code Here

Examples of org.apache.velocity.exception.ResourceNotFoundException

     */
    public synchronized InputStream getResourceStream(String name)
            throws ResourceNotFoundException {

        if (name == null || name.length() == 0) {
            throw new ResourceNotFoundException("No template name provided");
        }

        try {
            if (!name.startsWith("/"))
                name = "/" + name;

            return servletContext.getResourceAsStream(name);
        }
        catch (Exception fnfe) {
            /*
             *  log and convert to a general Velocity ResourceNotFoundException
             */

            throw new ResourceNotFoundException(fnfe.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.velocity.exception.ResourceNotFoundException

     */
    public InputStream getResourceStream(String source) throws ResourceNotFoundException {
        try {
            return resourceLoader.getResource(source).getInputStream();
        } catch (IOException ioe) {
            throw new ResourceNotFoundException("Could not get stream for resource '" + source + "'", ioe);
        }
    }
View Full Code Here

Examples of org.apache.velocity.exception.ResourceNotFoundException

                String path = paths.get(i);
                return new FileInputStream(path + "/" + template);
            } catch (FileNotFoundException e) { }
        }

        throw new ResourceNotFoundException(template);
    }
View Full Code Here

Examples of org.apache.velocity.exception.ResourceNotFoundException

                {
                    log.debug(msg);
                }
                if (required)
                {
                    throw new ResourceNotFoundException(msg);
                }
            }
            else
            {
                read(inputStream);
View Full Code Here

Examples of org.apache.wookie.exceptions.ResourceNotFoundException

      UnauthorizedAccessException, IOException {
    // attempt to get specific widget by id; note that this is the internal
    // widget integer ID and not the widget URI
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidget widget = persistenceManager.findById(IWidget.class, resourceId);
    if (widget == null) throw new ResourceNotFoundException();
    // redirect to the UDD
    if (widget.getUpdateLocation() ==  null) throw new ResourceNotFoundException();
    response.sendRedirect(widget.getUpdateLocation());
  }
View Full Code Here

Examples of org.archenos.locator.ResourceNotFoundException

    public URL findResource(String resourceName) throws ResourceNotFoundException {
        ClassLoader loader = getClasssLoader();
        URL path = loader.getResource(resourceName);

        if (path == null) {
            throw new ResourceNotFoundException("Resource \"" + resourceName + "\" not found.");
        }

        return path;
    }
View Full Code Here

Examples of org.bladerunnerjs.model.exception.request.ResourceNotFoundException

 
  public Map<String,Map<String,String>> getTagsAndAttributesFromIndexPage(BrowsableNode browsableNode, Locale locale, String version, UrlContentAccessor contentAccessor, RequestMode requestMode) throws ContentProcessingException, ResourceNotFoundException {
    File indexPage = getIndexPage(browsableNode);
    try {
      if ( !Arrays.asList(app.appConf().getLocales()).contains(locale) ) {
        throw new ResourceNotFoundException("The locale '"+locale+"' is not a valid locale for this app.");
      }
     
      String pathRelativeToApp = RelativePathUtility.get(app.root().getFileInfoAccessor(), app.dir(), indexPage);
      ByteArrayOutputStream indexPageContent = new ByteArrayOutputStream();
      contentAccessor.writeLocalUrlContentsToOutputStream(pathRelativeToApp, indexPageContent);
View Full Code Here

Examples of org.codehaus.plexus.resource.loader.ResourceNotFoundException

                getLogger().debug( "The resource " + "'" + name + "'" + " was not found with resourceLoader "
                                       + resourceLoader.getClass().getName() + "." );
            }
        }

        throw new ResourceNotFoundException( name );
    }
View Full Code Here

Examples of org.eclipse.maven.core.exception.ResourceNotFoundException

  public static String resolveJavaHome() throws ResourceNotFoundException {
    String jdk = resolveResourcePath(PreferencesConstants.JAVA_HOME);
   
    if (jdk == null || jdk.isEmpty())
      throw new ResourceNotFoundException(
          "You must define the path to the jdk.");
   
    return jdk;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.