Package com.ramforth.webserver.exceptions

Examples of com.ramforth.webserver.exceptions.ResourceNotFoundException


            } else {
                return resources.get(relativePath.toLowerCase());
            }
        }
        catch (NullPointerException npex) {
            throw new ResourceNotFoundException(npex);
        }
    }
View Full Code Here


        try {
            IHttpResource found = resources.get(value.getRelativePath().toLowerCase());
            this.defaultResource = found;
        }
        catch (NullPointerException npex) {
            throw new ResourceNotFoundException(npex);
        }
    }
View Full Code Here

        return resourceProvider.getResource(uriPath);
    }

    protected void assertFileExists(File file) {
        if (!file.exists()) {
            throw new ResourceNotFoundException("File not found.");
        }
    }
View Full Code Here

        }
    }

    protected void assertFileIsReadable(File file) {
        if (!file.canRead()) {
            throw new ResourceNotFoundException("File not found.");
        }
    }
View Full Code Here

            finally {
            }
        }
        catch (FileNotFoundException ex) {
            LOGGER.warn("File ' + " + file.getPath() + "' not found!", ex);
            throw new ResourceNotFoundException("File not found.");
        }
    }
View Full Code Here

                }
            }
        }
        catch (IOException ex) {
            LOGGER.warn("Colud not read from URL ' + " + url.getPath() + "'!", ex);
            throw new ResourceNotFoundException("File not found.");
        }
    }
View Full Code Here

            IHttpResponseWriter httpResponseWriter = new HttpResponseWriter(httpResponse.getOutputStream());
            httpResponseWriter.writeResponse(httpResponse);
        }
        catch (IOException ioex) {
            LOGGER.warn("Colud not read from URL ' + " + url.getPath() + "'!", ioex);
            throw new ResourceNotFoundException("File not found.");
        }
    }
View Full Code Here

TOP

Related Classes of com.ramforth.webserver.exceptions.ResourceNotFoundException

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.