Java Doc for ResourceFinder.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » resources » 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 » Web Framework » rife 1.6.1 » com.uwyn.rife.resources 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.uwyn.rife.resources.ResourceFinder

All known Subclasses:   com.uwyn.rife.resources.AbstractResourceFinder,  com.uwyn.rife.resources.DatabaseResources,
ResourceFinder
public interface ResourceFinder (Code)
This interface defines the methods that classes with ResourceFinder functionalities have to implement.

A ResourceFinder provides an abstract way of working with resources. According to a name, a resource can be searched for and its location is returned as an URL object.

It also possible to obtain a stream to read the resource's content, to retrieve all its contents as a String and to obtain the modification time of the resource.
author:
   Geert Bevin (gbevin[remove] at uwyn dot com)
version:
   $Revision: 3634 $
See Also:   com.uwyn.rife.resources.ResourceWriter
since:
   1.0





Method Summary
public  StringgetContent(String name)
     Retrieves the complete content of the resource that corresponds to the provided name.
public  StringgetContent(String name, String encoding)
     Retrieves the complete content of the resource that corresponds to the provided name.
public  StringgetContent(URL resource)
     Retrieves the complete content of the provided resource.
public  StringgetContent(URL resource, String encoding)
     Retrieves the complete content of the provided resource.
public  longgetModificationTime(String name)
     Retrieves the modification time of the resource that corresponds to the provided name.
public  longgetModificationTime(URL resource)
     Retrieves the modification time of the provided resource.
public  URLgetResource(String name)
     Retrieves the resource that corresponds to the provided name.
public  ResultTypeuseStream(String name, InputStreamUser user)
     Returns a stream that can be used to read the contents of the resource that corresponds to the provided name.
public  ResultTypeuseStream(URL resource, InputStreamUser user)
     Returns a stream that can be used to read the contents of the provided resource.



Method Detail
getContent
public String getContent(String name) throws ResourceFinderErrorException(Code)
Retrieves the complete content of the resource that corresponds to the provided name. The content will be read into a string by using the platform's default encoding.
Parameters:
  name - the name of the resource to retrieve a String object that contains the complete contentof the resource with the provided name; or

null if the resource couldn't be found.
throws:
  ResourceFinderErrorException - when an error occurred during theretrieval of the content.
See Also:   ResourceFinder.getContent(String,String)
See Also:   ResourceFinder.getContent(URL,String)
since:
   1.0




getContent
public String getContent(String name, String encoding) throws ResourceFinderErrorException(Code)
Retrieves the complete content of the resource that corresponds to the provided name.
Parameters:
  name - the name of the resource to retrieve the content from
Parameters:
  encoding - the encoding that should be used to read the content a String object that contains the complete contentof the resource with the provided name; or

null if the resource couldn't be found.
throws:
  ResourceFinderErrorException - when an error occurred during theretrieval of the content or when the encoding is not supported.
See Also:   ResourceFinder.getContent(String)
See Also:   ResourceFinder.getContent(URL)
See Also:   ResourceFinder.getContent(URL,String)
since:
   1.0




getContent
public String getContent(URL resource) throws ResourceFinderErrorException(Code)
Retrieves the complete content of the provided resource. The content will be read into a string by using the platform's default encoding.
Parameters:
  resource - the resource to retrieve the content from a String object that contains the complete contentof the resource with the provided name; or

null if the resource couldn't be found.
throws:
  ResourceFinderErrorException - when an error occurred during theretrieval of the content or when the encoding is not supported.
See Also:   ResourceFinder.getContent(String)
See Also:   ResourceFinder.getContent(String,String)
See Also:   ResourceFinder.getContent(URL,String)
since:
   1.0




getContent
public String getContent(URL resource, String encoding) throws ResourceFinderErrorException(Code)
Retrieves the complete content of the provided resource.
Parameters:
  resource - the resource to retrieve the content from
Parameters:
  encoding - the encoding that should be used to read the content a String object that contains the complete contentof the resource with the provided name; or

null if the resource couldn't be found.
throws:
  ResourceFinderErrorException - when an error occurred during theretrieval of the content or when the encoding is not supported.
See Also:   ResourceFinder.getContent(String)
See Also:   ResourceFinder.getContent(String,String)
See Also:   ResourceFinder.getContent(URL)
since:
   1.0




getModificationTime
public long getModificationTime(String name) throws ResourceFinderErrorException(Code)
Retrieves the modification time of the resource that corresponds to the provided name.
Parameters:
  name - the name of the resource to retrieve a positive long with the modification time inmilliseconds; or

-1 if the resource couldn't be found.
throws:
  ResourceFinderErrorException - when an error occurred during theretrieval of the modification time.
See Also:   ResourceFinder.getModificationTime(URL)
since:
   1.0




getModificationTime
public long getModificationTime(URL resource) throws ResourceFinderErrorException(Code)
Retrieves the modification time of the provided resource.
Parameters:
  resource - the resource to retrieve the modification time from a positive long with the modification time inmilliseconds; or

-1 if the resource couldn't be found.
throws:
  ResourceFinderErrorException - when an error occurred during theretrieval of the modification time.
See Also:   ResourceFinder.getModificationTime(String)
since:
   1.0




getResource
public URL getResource(String name)(Code)
Retrieves the resource that corresponds to the provided name.

This method never throws an exception, but returns null in case of an exception.
Parameters:
  name - the name of the resource to retrieve the URL object that corresponds to the provided name; or

null if the resource couldn't be found or if an erroroccurred.
since:
   1.0




useStream
public ResultType useStream(String name, InputStreamUser user) throws ResourceFinderErrorException, InnerClassException(Code)
Returns a stream that can be used to read the contents of the resource that corresponds to the provided name.
Parameters:
  name - the name of the resource to retrieve
Parameters:
  user - an instance of InputStreamUserthat contains the logic that will be executed with this stream the return value from the useInputStream method ofthe provided InputStreamUser instance
exception:
  ResourceFinderErrorException - when an error occurred during thecreation or opening of the stream.
exception:
  InnerClassException - when errors occurs inside the InputStreamUser
See Also:   InputStreamUser
See Also:   ResourceFinder.useStream(URL,InputStreamUser)
since:
   1.0



useStream
public ResultType useStream(URL resource, InputStreamUser user) throws ResourceFinderErrorException, InnerClassException(Code)
Returns a stream that can be used to read the contents of the provided resource.
Parameters:
  resource - the resource to retrieve
Parameters:
  user - an instance of InputStreamUserthat contains the logic that will be executed with this stream the return value from the useInputStream method ofthe provided InputStreamUser instance
exception:
  ResourceFinderErrorException - when an error occurred during thecreation or opening of the stream.
exception:
  InnerClassException - when errors occurs inside the InputStreamUser
See Also:   InputStreamUser
See Also:   ResourceFinder.useStream(String,InputStreamUser)
since:
   1.0



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