FileDocCategorySizeDatePackage
JarEntrySource.javaAPI DocGlassfish v2 API3503Fri May 04 22:32:08 BST 2007com.sun.enterprise.util

JarEntrySource

public class JarEntrySource extends Object

Fields Summary
private boolean
markOnly
private String
name
private InputStream
is
private File
file
private long
modifiedTime
Constructors Summary
public JarEntrySource(File file)

	this.markOnly = false;
	this.name = file.getPath().replace(File.separatorChar, '/");
	this.file = file;
    
public JarEntrySource(String name, File file)

	this.markOnly = false;
	this.name = name;
	this.file = file;
    
public JarEntrySource(String name, InputStream is)

	this.markOnly = false;
	this.name = name;
	this.is = is;
    
public JarEntrySource(String name)

	this.markOnly = true;
	this.name = name;
    
Methods Summary
public java.io.InputStreamgetInputStream()

	if (file != null) {
	    try {
		return new FileInputStream(file);
	    } catch (Exception ex) {
		return null;
	    }
	} else {
	    return is;
	}
    
public longgetLength()

	if (file != null) {
	    return file.length();
	} else {
	    return 0;		// ??
	}
    
public java.lang.StringgetName()

	return name;
    
public longgetTime()

	if (file != null) {
	    return file.lastModified();
	} else {
	    return 0;		// ??
	}
    
public booleanisMarkOnly()
Accessors

	return markOnly;
    
public java.lang.StringtoString()

	return file == null ? getName() : file.toString();