Package com.orange.wink.exception

Examples of com.orange.wink.exception.WinkBuildException


      buildFile.close();
      goodExecution = true;
    } catch (final org.mozilla.javascript.EcmaError e) {
      goodExecution = false;
    } catch (final FileNotFoundException e) {
      throw new WinkBuildException(e);
    } catch (final IOException e) {
      throw new WinkBuildException(e);
    }
    assertTrue(goodExecution, "Bad execution of " + filename);
  }
View Full Code Here


  /**
   * @throws WinkBuildException
   */
  public void execute() throws WinkBuildException {
    if (properties == null) {
      throw new WinkBuildException("WinkBuilder must be initialized first");
    }

    Constants.failOnUnmanagedSyntax = Boolean.valueOf(getProperty(Constants.OPTION_FAIL_ON_UNMANAGED_SYNTAX));
    Constants.warnOnUnmanagedSyntax = Boolean.valueOf(getProperty(Constants.OPTION_WARN_ON_UNMANAGED_SYNTAX));
    Constants.failOnUnresolvedNamespace = Boolean.valueOf(getProperty(Constants.OPTION_FAIL_ON_UNRESOLVED_NAMESPACE));
View Full Code Here

    final Map<String, String> propValues = new HashMap<String, String>();
    for (final String arg : args) {
      final Matcher m = optionPattern.matcher(arg);
      if (!m.matches() || m.groupCount() != 4) {
        throw new WinkBuildException("Bad Option [" + arg + "], must match:" + optionExpr);
      }
      propValues.put(m.group(2), m.group(4));
    }
    return propValues;
  }
View Full Code Here

      final Reader buildFile = new FileReader(new File(filename));
      final Script sc = cx.compileReader(buildFile, filename, 1, null);
      sc.exec(cx, thisObj);
      buildFile.close();
    } catch (final FileNotFoundException e) {
      throw new WinkBuildException(e);
    } catch (final IOException e) {
      throw new WinkBuildException(e);
    }
  }
View Full Code Here

   * @param args
   * @param funObj
   */
  public static void error(final Context cx, final Scriptable thisObj, final Object[] args, final Function funObj) throws WinkBuildException {
    if (args.length == 1 && args[0] != null && (args[0] instanceof String)) {
      throw new WinkBuildException((String) args[0]);
    }
    throw new WinkBuildException();
  }
View Full Code Here

   * @param args
   * @param funObj
   */
  public static void load(final Context cx, final Scriptable thisObj, final Object[] args, final Function funObj) throws WinkBuildException {
    if (args.length != 1 || args[0] == null || !(args[0] instanceof String)) {
      throw new WinkBuildException("load() error: bad arguments");
    }
    executeJsFile(cx, thisObj, (String) args[0]);
  }
View Full Code Here

   * @return
   * @throws WinkBuildException
   */
  public static boolean isReadableFile(final Context cx, final Scriptable thisObj, final Object[] args, final Function funObj) throws WinkBuildException {
    if (args.length != 1 || args[0] == null || !(args[0] instanceof String)) {
      throw new WinkBuildException("isReadableFile() error: bad arguments");
    }
    return FileUtil.isReadableFile((String) args[0]);
  }
View Full Code Here

   * @return
   * @throws WinkBuildException
   */
  public static boolean isDirectory(final Context cx, final Scriptable thisObj, final Object[] args, final Function funObj) throws WinkBuildException {
    if (args.length != 1 || args[0] == null || !(args[0] instanceof String)) {
      throw new WinkBuildException("isDirectory() error: bad arguments");
    }
    return FileUtil.isDirectory((String) args[0]);
  }
View Full Code Here

   * @return
   * @throws WinkBuildException
   */
  public static boolean createDirectory(final Context cx, final Scriptable thisObj, final Object[] args, final Function funObj) throws WinkBuildException {
    if (args.length != 1 || args[0] == null || !(args[0] instanceof String)) {
      throw new WinkBuildException("isDirectory() error: bad arguments");
    }
    try {
      return FileUtil.createDirectory((String) args[0], ".");
    } catch (final IOException e) {
      throw new WinkBuildException(e);
    }
  }
View Full Code Here

   * @return
   * @throws WinkBuildException
   */
  public static boolean deleteFile(final Context cx, final Scriptable thisObj, final Object[] args, final Function funObj) throws WinkBuildException {
    if (args.length != 1 || args[0] == null || !(args[0] instanceof String)) {
      throw new WinkBuildException("isDirectory() error: bad arguments");
    }
    return FileUtil.deleteFile((String) args[0]);
  }
View Full Code Here

TOP

Related Classes of com.orange.wink.exception.WinkBuildException

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.