net.sf.sail.core.util
Class BinaryUtils

java.lang.Object
  extended by net.sf.sail.core.util.BinaryUtils

public class BinaryUtils
extends java.lang.Object


Constructor Summary
BinaryUtils()
           
 
Method Summary
static java.net.URL addToArchive(Pod pod, java.util.zip.ZipOutputStream podArchiveOutputStream, java.lang.String filename, java.io.InputStream source)
           
static void cleanClosePodArchive(Pod pod, java.util.jar.JarOutputStream podArchive)
          TODO think of way to avoid this hack
static java.io.File createTempDir(java.lang.String tempDirName)
           
static CurnitFile curnitFileForArgs(java.lang.String[] args)
           
static java.io.File fileForCommandArgument(java.lang.String path)
           
static java.net.URL makeJarUrl(java.net.URL jarUrl, java.lang.String pathInJar)
           
static java.util.jar.JarOutputStream newPodArchiveFor(Pod pod)
          Note: ignores the previous archive associated with the pod
static java.io.File tempFileForUrl(java.lang.String externalForm)
           
static java.io.File tempFileForUrl(java.net.URL url)
           
static java.net.URL toFileUrl(java.net.URL location)
          Takes a URL that points to a resource within a JAR, unzips it onto the filesystem, and returns a file: url to it
static java.net.URL urlForCommandArgument(java.lang.String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryUtils

public BinaryUtils()
Method Detail

toFileUrl

public static java.net.URL toFileUrl(java.net.URL location)
                              throws java.io.IOException
Takes a URL that points to a resource within a JAR, unzips it onto the filesystem, and returns a file: url to it

Parameters:
location - points to a resource within a JAR
Returns:
file: URL to the specified jar: URL resource
Throws:
java.io.IOException

createTempDir

public static java.io.File createTempDir(java.lang.String tempDirName)
                                  throws java.io.IOException
Parameters:
tempDirName - TODO
Throws:
java.io.IOException

makeJarUrl

public static java.net.URL makeJarUrl(java.net.URL jarUrl,
                                      java.lang.String pathInJar)

tempFileForUrl

public static java.io.File tempFileForUrl(java.lang.String externalForm)
                                   throws java.io.IOException
Parameters:
externalForm -
Returns:
Throws:
java.io.IOException

tempFileForUrl

public static java.io.File tempFileForUrl(java.net.URL url)
                                   throws java.io.IOException
Parameters:
curnitArchiveUrl -
Returns:
Throws:
java.io.IOException

fileForCommandArgument

public static java.io.File fileForCommandArgument(java.lang.String path)
                                           throws java.io.IOException
Parameters:
path -
Returns:
Throws:
java.io.IOException

urlForCommandArgument

public static java.net.URL urlForCommandArgument(java.lang.String path)
                                          throws java.io.IOException
Parameters:
path -
Returns:
Throws:
java.io.IOException

addToArchive

public static java.net.URL addToArchive(Pod pod,
                                        java.util.zip.ZipOutputStream podArchiveOutputStream,
                                        java.lang.String filename,
                                        java.io.InputStream source)
                                 throws java.io.IOException
Throws:
java.io.IOException

newPodArchiveFor

public static java.util.jar.JarOutputStream newPodArchiveFor(Pod pod)
                                                      throws java.io.IOException
Note: ignores the previous archive associated with the pod

Parameters:
pod -
Returns:
a new JarOutputStream to which to write to the new archive
Throws:
java.io.IOException

cleanClosePodArchive

public static void cleanClosePodArchive(Pod pod,
                                        java.util.jar.JarOutputStream podArchive)
                                 throws java.io.IOException
TODO think of way to avoid this hack

Parameters:
pod -
podToArchive -
Throws:
java.io.IOException

curnitFileForArgs

public static CurnitFile curnitFileForArgs(java.lang.String[] args)
                                    throws java.io.IOException
Parameters:
args -
Returns:
Throws:
java.io.IOException


Copyright 2004-2004-2006 TELS Center. All Rights Reserved.