[jboss-cvs] jboss-seam-tools/src/java/org/jboss/seam/tools ...

Thomas Heute theute at jboss.com
Mon Aug 14 11:57:46 EDT 2006


  User: theute  
  Date: 06/08/14 11:57:46

  Added:       src/java/org/jboss/seam/tools   UtilityJar.java Util.java
  Log:
  Moved to hibernate Tools
  
  (ban cvs imports)
  
  Revision  Changes    Path
  1.1      date: 2006/08/14 15:57:46;  author: theute;  state: Exp;jboss-seam-tools/src/java/org/jboss/seam/tools/UtilityJar.java
  
  Index: UtilityJar.java
  ===================================================================
  package org.jboss.seam.tools;
  
  
  /**
   * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
   * @version <tt>$Revision: 1.1 $</tt>
   */
  public class UtilityJar {
  
  	public String filename;
  	
  	public UtilityJar(String filename)
  	{
  		this.filename = filename;
  	}
  
  	public String getFilename() {
  		return filename;
  	}
  
  	public void setFilename(String filename) {
  		this.filename = filename;
  	}
  	
  }
  
  
  
  1.1      date: 2006/08/14 15:57:46;  author: theute;  state: Exp;jboss-seam-tools/src/java/org/jboss/seam/tools/Util.java
  
  Index: Util.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.seam.tools;
  
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  
  /**
   * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
   * @version <tt>$Revision: 1.1 $</tt>
   */
  public class Util {
  	
  	public static void createDirectory(String directoryName) throws IOException {
  		boolean created = new File(directoryName).mkdirs();
  		if (!created)
  		{
  			throw new IOException("Cannot create directory: " + directoryName);
  		}
  	}
  	
  	public static void copy(File src, File dst) throws IOException {
          InputStream in = new FileInputStream(src);
          OutputStream out = new FileOutputStream(dst);
      
          // Transfer bytes from in to out
          byte[] buf = new byte[1024];
          int len;
          while ((len = in.read(buf)) > 0) {
              out.write(buf, 0, len);
          }
          in.close();
          out.close();
      }
  
  }
  
  
  



More information about the jboss-cvs-commits mailing list