Package com.netfever.common.exceptions

Examples of com.netfever.common.exceptions.FaultDetails


  public static void checkFolderExists(final File f) throws NetfeverException {
    UUID uuid = UUID.randomUUID();
   
    if (!f.exists()) {
      throw new NetfeverException(
          new FaultDetails(
            uuid.toString(),
            0,
            "The folder does not exists. Contact administrator with error: " + uuid,
            "The folder at location " + f.getAbsolutePath() + " does not exists.",
            null
          ));     
    }

    if (!f.isDirectory()) {
      throw new NetfeverException(
          new FaultDetails(
            uuid.toString(),
            0,
            "The file does not exists. Contact administrator with error: " + uuid,
            "The path location " + f.getAbsolutePath() + " is a file not a folder.",
            null
View Full Code Here


  public static void checkIsFile(final File f) throws NetfeverException {
    final UUID uuid = UUID.randomUUID();
   
    if (f.exists() && (!f.isFile())) {
      throw new NetfeverException(
          new FaultDetails(
            uuid.toString(),
            0,
            "The file does not exists. Contact administrator with error: " + uuid,
            "The path location " + f.getAbsolutePath() + " is a folder not a file.",
            null
View Full Code Here

  public static void checkIsFolder(final File f) throws NetfeverException {
    final UUID uuid = UUID.randomUUID();
   
    if (f.exists() && (!f.isDirectory())) {
      throw new NetfeverException(
          new FaultDetails(
            uuid.toString(),
            0,
            "The file does not exists. Contact administrator with error: " + uuid,
            "The path location " + f.getAbsolutePath() + " is a file not a folder.",
            null
View Full Code Here

   
    try {
      return new FileInputStream(filename)
    } catch (FileNotFoundException e) {
      throw new NetfeverException(
        new FaultDetails(
          uuid.toString(),
          0,
          "The file does not exists. Contact administrator with error: " + uuid,
          "The path location " + filename + " is a file not a folder.",
          null
View Full Code Here

        xmlResource = LOADER.getResource(springpath);
        factory = new XmlBeanFactory(xmlResource);
        this.value = factory.getBean(objectid);
      } catch (BeansException e) {
        throw new VerifyRuntimeException(
            new FaultDetails(
                null,
                -1,
                "Creating Spring based bean raised " + e.getMessage(),
                null,
                null),
            e);
      }
    } else {
      throw new VerifyRuntimeException(
          new FaultDetails(
              null,
              -1,
              "The spring value {" + value + "} should be formated as objectid@springpath.",
              null,
              null));
View Full Code Here

      final Class<?> res = loader.loadClass(className);
     
      return res;
    } catch (ClassNotFoundException e) {
      throw new NetfeverException(
          new FaultDetails(
            UUID.randomUUID().toString(),
            -1,
            String.format("Error loading '%s' with error '%s'", className, e.getMessage()),
            null,
            null));
View Full Code Here

    try {
      final Object res = clazz.newInstance();
      return res;
    } catch (InstantiationException e) {
      throw new NetfeverException(
          new FaultDetails(
            UUID.randomUUID().toString(),
            -1,
            String.format("Problem instantiating '%s' with error '%s'", clazz.getName(), e.getMessage()),
            null,
            "if this Class represents an abstract class, an interface, an array class, a primitive type, or void; " +
            "or if the class has no nullary constructor; or if the instantiation fails for some other reason."));
    } catch (IllegalAccessException e) {
      throw new NetfeverException(
          new FaultDetails(
            UUID.randomUUID().toString(),
            -1,
            String.format("Problem accessing '%s' with error '%s'", clazz.getName(), e.getMessage()),
            "if the class or its nullary constructor is not accessible.",
            null));
View Full Code Here

import com.netfever.common.exceptions.FaultDetails;

public final class VerifyRuntimeExceptionFactory
  public static VerifyRuntimeException createPropertyInvalidNamespaceException(String namespace, String key) {
    return new VerifyRuntimeException(
        new FaultDetails(
            null,
            -1,
            "The property with key {" + key + "} should start with {" +  namespace +  ".}",
            null,
            null));
View Full Code Here

            null));
  }
 
  public static VerifyRuntimeException createPropertyUnknownNamespaceException(String key) {
    return new VerifyRuntimeException(
        new FaultDetails(
            null,
            -1,
            "The property with key {" + key + "} should start with a valid namespace such as {system.}, {java.} or {spring.}",
            null,
            null));
View Full Code Here

      LogUtils.error(log, e);
      response.setStatus(404);
    } catch (Exception e) {
      UUID uuid = UUID.randomUUID();
     
      FaultDetails details = new FaultDetails(
        uuid.toString(),
        0,
        "Error reading stream " +
        relativePath +
        " with error " +
View Full Code Here

TOP

Related Classes of com.netfever.common.exceptions.FaultDetails

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.