Examples of SuperNannyError


Examples of com.tuenti.supernanny.SuperNannyError

    boolean didIncrease = false;

    for (int i = 0; i < latestParts.length; i++) {
      if (didIncrease) {
        if (formatParts.length > i) {
          throw new SuperNannyError(
              "Given format is not correct; cannot contain anything after the first +.");
        }
        // already increased, just pad 0
        nextVersion.append(0);
      } else if (formatParts[i].equals("x")) {
        // use
        nextVersion.append(latestParts[i]);
      } else if (formatParts[i].equals("+")) {
        // increase
        if (!didIncrease) {
          nextVersion.append(1 + Integer.parseInt(latestParts[i].toString()));
          didIncrease = true;
        } else {
          throw new SuperNannyError(
              "Given format is not correct; can only contain a single +.");
        }
      } else {
        throw new SuperNannyError(
            "Entered format is wrong; can only contain delimiters, + and x.");
      }

      // add the format delimiter if not last iteration
      if (latestParts.length > i + 1) {
View Full Code Here

Examples of com.tuenti.supernanny.SuperNannyError

            urlgz.openStream())));
      } catch (FileNotFoundException e) {
        try {
          in = new BufferedReader(new InputStreamReader(urlplain.openStream()));
        } catch (FileNotFoundException f) {
          throw new SuperNannyError("Can't find index file " + urlgz + " or " + urlplain);
        }
      }

      IndexReader indexReader = new IndexReader(in);
      setArtifacts(indexReader.parse());
View Full Code Here

Examples of com.tuenti.supernanny.SuperNannyError

  public String handle() {
    try {
      fetcher.resolve(new File("."), p);
    } catch (IOException e) {
      l.warning(e.getMessage());
      throw new SuperNannyError(e);
    }
    return null;
  }
View Full Code Here

Examples of com.tuenti.supernanny.SuperNannyError

              version, d.getRepository()));
        }
      } else {
        if (!util.confirmYN("Version " + version
            + " will be published - do you want to proceed?")) {
          throw new SuperNannyError("User aborted");
        }
        new DepPublisher().resolve(exports, version.getVersionString(), p);
      }
    } catch (IOException e) {
      l.warning(e.getMessage());
      throw new SuperNannyError(e);
    }
    return null;
  }
View Full Code Here

Examples of com.tuenti.supernanny.SuperNannyError

      FileWriter fstream = new FileWriter(f);
      BufferedWriter out = new BufferedWriter(fstream);
      out.write(MessageFormat.format("[paths]\ndefault = {0}\n", uri));
      out.close();
    } catch (Exception e) {
      throw new SuperNannyError(MessageFormat.format(
          "Cannot write to .hg/hgrc of {0}... Exiting...", depFolder));
    }

    return version;
  }
View Full Code Here

Examples of com.tuenti.supernanny.SuperNannyError

      in.close();
      String[] retval = new String[tags.size()];
      tags.toArray(retval);
      return retval;
    } catch (MalformedURLException e) {
      throw new SuperNannyError(e);
    }
  }
View Full Code Here

Examples of com.tuenti.supernanny.SuperNannyError

    // split tag names only
    int i = 0;
    for (String tag : fullTags) {
      String[] splitTags = tag.split("\\s");
      if (splitTags.length != 2) {
        throw new SuperNannyError(MessageFormat.format(
            "Tags not found in {1}. Make sure the correct tag exists.", uri));
      } else {
        tags[i++] = splitTags[1].replace("refs/tags/", "");
      }
    }
View Full Code Here

Examples of com.tuenti.supernanny.SuperNannyError

    String source = repo.getAbsolutePath();
    if (path != null && !"".equals(path)) {
      source += File.separator + path;
      if (!new File(source).exists()) {
        throw new SuperNannyError("The specified subpath \"" + path + "\" doesn't exist!");
      }
    }

    // resolve symlinks pointing outside of the copied directory
    util.readProcess("rsync --archive --delete --copy-unsafe-links " + source +"/ " + destination);
View Full Code Here

Examples of com.tuenti.supernanny.SuperNannyError

      fos.getChannel().transferFrom(rbc, 0, 1 << 27);
      fos.flush();
      fos.close();
      l.fine("File downloaded to " + tmpFile.toString());
    } catch (IOException e) {
      throw new SuperNannyError(e);
    }

    return tmpFile;
  }
View Full Code Here

Examples of com.tuenti.supernanny.SuperNannyError

          throw e;
        }
      }
    } while (!fileAuthentication && wrongPassword && tries < 3);
   
    throw new SuperNannyError("Error publishing artifact.");
  }
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.