Java Doc for Resource.java in  » J2EE » Enhydra-Application-Framework » com » lutris » classloader » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Enhydra Application Framework » com.lutris.classloader 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.lutris.classloader.Resource

All known Subclasses:   com.lutris.classloader.LocalZipResource,  com.lutris.classloader.RemoteZipResource,  com.lutris.classloader.RemoteDirResource,  com.lutris.classloader.LocalDirResource,
Resource
abstract public class Resource (Code)

A resource that is a file existing on the local machine or a remote machine. The properties of a resource include file name, location, size, and last-modified time. The location of the resource is represented by a ClassPathEntry and is either a directory or a zip file. The file name, described by a String, is relative to the specified location. The resource size is the file size in bytes and the resource time is the last-modified time of the file in milliseconds.

This is an abstract class. All subclasses must determine the size and last-modified time for the resource, and must implement the getInputStream method.

Resources can be ASCII or binary files, such as text files, HTML files, Java source-code files, Java byte-code files, Java archive (JAR) files, and gif files. Some examples resource file names are:

 /users/kristen/text/schedule.txt
 /webserver/htdocs/index.html
 /jdk1.1.5/src/java/util/Enumeration.java
 /jdk1.1.5/classes/java/util/Enumeration.class
 /users/kristen/lutris/lutris.jar
 /webserver/htdocs/banner.gif
 
Since the file names are relative to the location, the beginning slash ("/") does NOT mean that the file name is given as the absolute path on its host machine.
author:
   Kristen Pol, Lutris Technologies
version:
   $Revision : 1.1 $
See Also:   com.lutris.classloader.ClassPathEntry


Field Summary
protected  longlastModifiedTime
     The last-modified time of the resource when this object was created.
protected  ClassPathEntrylocation
     The location of the resource, which can be local or remote.
protected  LogChannellogChannel
    
protected  intlogLevel
    
protected  booleanloggingEnabled
    
protected  Stringname
     The file name of the resource relative to the location.
protected  longsize
     The size of the resource in bytes.

Constructor Summary
protected  Resource(String name, ClassPathEntry location, LogChannel loadLogChannel)
     Constructs resource with specified name, location and log channel. The file name must be described relative to the location.

Method Summary
public  booleanequals(Resource resource)
     Determines if the specified resource is equal to this resource.
public  byte[]getBytes()
     Gets byte array representing resource.
abstract public  longgetCurrentLastModifiedTime()
     Get current last-modification time of resource.
abstract public  InputStreamgetInputStream()
     Gets input stream representing resource.
public  longgetLastModifiedTime()
     Gets last-modification time of resource at the time this Resource object was created.
public  ClassPathEntrygetLocation()
     Gets location of resource set previously by constructor.
public  StringgetName()
     Gets file name of resource set previously by constructor.
public  longgetSize()
     Gets size of resource in bytes.
public  longgetTime()
     Gets last-modified time of resource in milliseconds.
public  booleanhasBeenModified()
     Determine if the resource has been modified since it was loaded.
public  StringtoString()
     Stringifies resource described previously by constructor.

Field Detail
lastModifiedTime
protected long lastModifiedTime(Code)
The last-modified time of the resource when this object was created.



location
protected ClassPathEntry location(Code)
The location of the resource, which can be local or remote.



logChannel
protected LogChannel logChannel(Code)
Log channel to write messages to



logLevel
protected int logLevel(Code)
Numeric log level number for LOGLEVEL string



loggingEnabled
protected boolean loggingEnabled(Code)
Is logging enabled?



name
protected String name(Code)
The file name of the resource relative to the location.



size
protected long size(Code)
The size of the resource in bytes.




Constructor Detail
Resource
protected Resource(String name, ClassPathEntry location, LogChannel loadLogChannel) throws NullPointerException(Code)
Constructs resource with specified name, location and log channel. The file name must be described relative to the location. The location, described by the ClassPathEntry, can be a directory or a zip file on the local or a remote machine.

Assumes that all slashes in the name parameter are forward slashes ("/");
Parameters:
  name - The file name of the resource.
Parameters:
  location - The location of the resource.
Parameters:
  loadLogChannel - The log channel for logging.
exception:
  NullPointerException - if either the name orlocation parameters are null.
See Also:   ClassPathEntry





Method Detail
equals
public boolean equals(Resource resource)(Code)
Determines if the specified resource is equal to this resource. Resources are considered equal if the file names, locations, sizes, and last-modified times are all the same. true if the resources are equal, false if not.



getBytes
public byte[] getBytes() throws IOException(Code)
Gets byte array representing resource.

This method relies on the implementation of getInputStream. an array of bytes representing the resource.
exception:
  IOException - if the byte array can not be constructed.




getCurrentLastModifiedTime
abstract public long getCurrentLastModifiedTime() throws FileNotFoundException(Code)
Get current last-modification time of resource. This is the time on the disk file the resource is associated with. the last-modified time of the permanent copy of the resourcein milliseconds.



getInputStream
abstract public InputStream getInputStream() throws IOException(Code)
Gets input stream representing resource.

This method is abstract and must be implemented by all subclasses. The getBytes method also depends upon this implementation. the input stream that represents the resource.
exception:
  IOException - if the input stream can not be constructed.




getLastModifiedTime
public long getLastModifiedTime()(Code)
Gets last-modification time of resource at the time this Resource object was created.

All subclasses are expected to determine this time prior to this method being called. the last-modified time of the resource in milliseconds.




getLocation
public ClassPathEntry getLocation()(Code)
Gets location of resource set previously by constructor. the location of the resource represented by aClassPathEntry.



getName
public String getName()(Code)
Gets file name of resource set previously by constructor. the file name of the resource represented by aString.



getSize
public long getSize()(Code)
Gets size of resource in bytes.

All subclasses are expected to determine this size prior to this method being called. the size of the resource in bytes.




getTime
public long getTime()(Code)
Gets last-modified time of resource in milliseconds.
See Also:   getlastModifiedTime



hasBeenModified
public boolean hasBeenModified() throws FileNotFoundException(Code)
Determine if the resource has been modified since it was loaded. true if the resource has been modified,false if not.



toString
public String toString()(Code)
Stringifies resource described previously by constructor. The the file name and location are concatenated together to represent the resource. the resource represented by a String composed ofthe file name and location.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.