Package de.matrixweb.smaller.clients.common

Examples of de.matrixweb.smaller.clients.common.Util


   * @see org.apache.tools.ant.Task#execute()
   */
  @Override
  public void execute() {
    try {
      final Util util = new Util(new AntLogger(), this.debug);

      final File temp = File.createTempFile("smaller-ant", ".dir");
      try {
        temp.delete();
        temp.mkdirs();

        log("Reading config-file: " + this.configFilePath);
        if (!this.configFilePath.exists()) {
          throw new RuntimeException(this.configFilePath.toString());
        }
        final ConfigFile configFile = ConfigFile.read(this.configFilePath);

        final List<String> includedFiles = new ArrayList<String>();
        for (final String envName : configFile.getBuildServer()
            .getEnvironments()) {
          final Environment env = configFile.getEnvironments().get(envName);
          for (final String dir : env.getFiles().getFolder()) {
            copyFirstInputFile(env, dir, temp);

            final String base = new File(this.configFilePath.getParentFile(),
                dir).getAbsolutePath();
            final String[] included = scanIncludedFiles(base, env.getFiles()
                .getIncludes(), env.getFiles().getExcludes());

            for (final String include : included) {
              FileUtils.copyFile(new File(base, include), new File(temp,
                  include));
              includedFiles.add(include);
            }
          }
        }

        util.unzip(this.target, util.send(this.host, this.port, this.proxyhost,
            this.proxyport, util.zip(temp, includedFiles, configFile)));
      } finally {
        FileUtils.deleteDirectory(temp);
      }
    } catch (final IOException e) {
      log(Util.formatException(e), Project.MSG_ERR);
View Full Code Here


  protected void executeSmaller(final File base,
      final List<String> includedFiles, final File target, final String host,
      final String port, final String proxyhost, final String proxyport,
      final ConfigFile configFile) throws ExecutionException {
    final Util util = new Util(new MavenLogger());
    util.unzip(
        target,
        util.send(host, port, proxyhost, proxyport,
            util.zip(base, includedFiles, configFile)));
  }
View Full Code Here

            .println("\tThe input is read from stdin the output is written to stdout");
        System.exit(1);
      }
    }

    final Util util = new Util(new Logger() {
      public void debug(final String message) {
        System.err.println(message);
      }
    });
    // IOUtils.write(IOUtils.toByteArray(System.in), System.out);
    // System.exit(1);
    System.err.println(String.format("Connect to %s:%s", host, port));
    IOUtils.write(util.send(host, port, IOUtils.toByteArray(System.in)),
        System.out);
  }
View Full Code Here

TOP

Related Classes of de.matrixweb.smaller.clients.common.Util

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.