Package com.netfever.common.exceptions

Examples of com.netfever.common.exceptions.NetfeverException


          in.close();
        }

        return showreel;
    } catch (IOException e) {
      throw new NetfeverException(
          new FaultDetails(
              null,
              -1,
              e.getMessage(),
              null,
              null));
    } catch (SAXException e) {
      throw new NetfeverException(
          new FaultDetails(
              null,
              -1,
              e.getMessage(),
              null,
View Full Code Here


        in.close();
      }
     
      return sb.toString();     
    } catch (IOException e) {
      throw new NetfeverException(
          new FaultDetails(null, -1, e.getMessage(), null, null),
          e);
    }
  }
View Full Code Here

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

    if (!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.",
View Full Code Here

  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.",
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.",
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.",
View Full Code Here

    final UUID uuid = UUID.randomUUID();
   
    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.",
View Full Code Here

    try {
      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,
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.",
View Full Code Here

import com.netfever.common.exceptions.NetfeverException;

public final class Validate {
  public static void notNull(final Object o, final FaultDetails details) throws NetfeverException {
    if (o == null) {
      throw new NetfeverException(details);
    }
  }
View Full Code Here

TOP

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

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.