Java Doc for FileManager.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » util » 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 » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.util.FileManager

FileManager
public class FileManager (Code)
FileManager A FileManager provides access to named file-like resources by opening InputStreams to things in the filing system, by URL (http: and file:) and found by the classloader. It can also load RDF data from such a system resource into an existing model or create a new (Memory-based) model. There is a global FileManager which provide uniform access to system resources: applications may also create specialised FileManagers. A FileManager contains a list of location functions to try: the global FileManger has one LocatorFile , one LocatorClassLoader and one LocatorURL Main operations:
  • loadModel, readModel : URI to model
  • open, openNoMap : URI to input stream
  • mapURI : map URI to another by LocationMapper
Utilities:
  • readWholeFileAsUTF8
  • optional caching of models
A FileManager works in conjunction with a LocationMapper. A LocationMapper is a set of alternative locations for system resources and a set of alternative prefix locations. For example, a local copy of a common RDF dataset may be used whenever the usual URL is used by the application. The LocatorFile also supports the idea of "current directory".
See Also:   LocationMapper
See Also:   FileUtils
author:
   Andy Seaborne
version:
   $Id: FileManager.java,v 1.41 2008/01/02 12:07:44 andy_seaborne Exp $


Field Summary
final public static  StringPATH_DELIMITER
    
 booleancacheModelLoads
    
final public static  StringfilePathSeparator
    
 Listhandlers
    
static  FileManagerinstance
    
static  booleanlogAllLookups
    
 LocationMappermapper
    
 ModelCachemodelCache
    

Constructor Summary
public  FileManager()
    
public  FileManager(FileManager filemanager)
     Create a new file manager that is a deep copy another.
public  FileManager(LocationMapper _mapper)
    

Method Summary
public  voidaddCacheModel(String uri, Model m)
    
public  voidaddLocator(Locator loc)
    
public  voidaddLocatorClassLoader(ClassLoader cLoad)
    
public  voidaddLocatorFile()
    
public  voidaddLocatorFile(String dir)
    
public  voidaddLocatorURL()
    
public  voidaddLocatorZip(String zfn)
    
public static  FileManagerget()
     Get the global file manager.
public  booleangetCachingModels()
    
public  ModelgetFromCache(String filenameOrURI)
    
public  LocationMappergetLocationMapper()
    
public  booleanhasCachedModel(String filenameOrURI)
    
public  ModelloadModel(String filenameOrURI)
     Load a model from a file (local or remote).
public  ModelloadModel(String filenameOrURI, String rdfSyntax)
     Load a model from a file (local or remote). URI is the base for reading the model.
Parameters:
  filenameOrURI - The filename or a URI (file:, http:)
Parameters:
  rdfSyntax - RDF Serialization syntax.
public  ModelloadModel(String filenameOrURI, String baseURI, String rdfSyntax)
     Load a model from a file (local or remote).
Parameters:
  filenameOrURI - The filename or a URI (file:, http:)
Parameters:
  baseURI - Base URI for loading the RDF model.
Parameters:
  rdfSyntax - RDF Serialization syntax.
public  Iteratorlocators()
    
public static  FileManagermakeGlobal()
     Create a "standard" FileManager.
public  StringmapURI(String filenameOrURI)
    
public  InputStreamopen(String filenameOrURI)
    
public  InputStreamopenNoMap(String filenameOrURI)
    
public  TypedStreamopenNoMapOrNull(String filenameOrURI)
     Open a file using the locators of this FileManager but without location mapping.
public  ModelreadModel(Model model, String filenameOrURI)
     Read a file of RDF into a model.
public  ModelreadModel(Model model, String filenameOrURI, String rdfSyntax)
     Read a file of RDF into a model.
Parameters:
  model -
Parameters:
  filenameOrURI -
Parameters:
  rdfSyntax - RDF Serialization syntax.
public  ModelreadModel(Model model, String filenameOrURI, String baseURI, String syntax)
     Read a file of RDF into a model.
public  StringreadWholeFileAsUTF8(InputStream in)
    
public  StringreadWholeFileAsUTF8(String filename)
    
public  Stringremap(String filenameOrURI)
    
public  voidremove(Locator loc)
    
public  voidremoveCacheModel(String uri)
    
public  voidresetCache()
    
public static  voidsetGlobalFileManager(FileManager globalFileManager)
    
public  voidsetLocationMapper(LocationMapper _mapper)
    
public  voidsetMapper(LocationMapper _mapper)
    
public  voidsetModelCaching(boolean state)
    
public static  voidsetStdLocators(FileManager fMgr)
     Force a file handler to have the default configuration.

Field Detail
PATH_DELIMITER
final public static String PATH_DELIMITER(Code)
Delimiter between path entries : because URI scheme names use : we only allow ;



cacheModelLoads
boolean cacheModelLoads(Code)



filePathSeparator
final public static String filePathSeparator(Code)



handlers
List handlers(Code)



instance
static FileManager instance(Code)



logAllLookups
static boolean logAllLookups(Code)



mapper
LocationMapper mapper(Code)



modelCache
ModelCache modelCache(Code)




Constructor Detail
FileManager
public FileManager()(Code)
Create an uninitialized FileManager



FileManager
public FileManager(FileManager filemanager)(Code)
Create a new file manager that is a deep copy another. Location mapper and locators chain are copied (the locators are not cloned). The model cache is not copied and is initially set to not cache.
Parameters:
  filemanager -



FileManager
public FileManager(LocationMapper _mapper)(Code)
Create with the given location mapper




Method Detail
addCacheModel
public void addCacheModel(String uri, Model m)(Code)



addLocator
public void addLocator(Locator loc)(Code)
Add a locator to the end of the locators list



addLocatorClassLoader
public void addLocatorClassLoader(ClassLoader cLoad)(Code)
Add a class loader locator



addLocatorFile
public void addLocatorFile()(Code)
Add a file locator



addLocatorFile
public void addLocatorFile(String dir)(Code)
Add a file locator which uses dir as its working directory



addLocatorURL
public void addLocatorURL()(Code)
Add a URL locator



addLocatorZip
public void addLocatorZip(String zfn)(Code)
Add a zip file locator



get
public static FileManager get()(Code)
Get the global file manager. the global file manager



getCachingModels
public boolean getCachingModels()(Code)
return whether caching is on of off



getFromCache
public Model getFromCache(String filenameOrURI)(Code)
Read out of the cache - return null if not in the cache



getLocationMapper
public LocationMapper getLocationMapper()(Code)
Get the location mapping



hasCachedModel
public boolean hasCachedModel(String filenameOrURI)(Code)



loadModel
public Model loadModel(String filenameOrURI)(Code)
Load a model from a file (local or remote). Guesses the syntax of the file based on filename extension, defaulting to RDF/XML.
Parameters:
  filenameOrURI - The filename or a URI (file:, http:) a new model
exception:
  JenaException - if there is syntax error in file.



loadModel
public Model loadModel(String filenameOrURI, String rdfSyntax)(Code)
Load a model from a file (local or remote). URI is the base for reading the model.
Parameters:
  filenameOrURI - The filename or a URI (file:, http:)
Parameters:
  rdfSyntax - RDF Serialization syntax. a new model
exception:
  JenaException - if there is syntax error in file.



loadModel
public Model loadModel(String filenameOrURI, String baseURI, String rdfSyntax)(Code)
Load a model from a file (local or remote).
Parameters:
  filenameOrURI - The filename or a URI (file:, http:)
Parameters:
  baseURI - Base URI for loading the RDF model.
Parameters:
  rdfSyntax - RDF Serialization syntax. a new model
exception:
  JenaException - if there is syntax error in file.



locators
public Iterator locators()(Code)
Return an iterator over all the handlers



makeGlobal
public static FileManager makeGlobal()(Code)
Create a "standard" FileManager.



mapURI
public String mapURI(String filenameOrURI)(Code)
Apply the mapping of a filename or URI



open
public InputStream open(String filenameOrURI)(Code)
Open a file using the locators of this FileManager



openNoMap
public InputStream openNoMap(String filenameOrURI)(Code)
Open a file using the locators of this FileManager but without location mapping



openNoMapOrNull
public TypedStream openNoMapOrNull(String filenameOrURI)(Code)
Open a file using the locators of this FileManager but without location mapping. Return null if not found



readModel
public Model readModel(Model model, String filenameOrURI)(Code)
Read a file of RDF into a model.
Parameters:
  model -
Parameters:
  filenameOrURI - The model or null, if there was an error.
exception:
  JenaException - if there is syntax error in file.



readModel
public Model readModel(Model model, String filenameOrURI, String rdfSyntax)(Code)
Read a file of RDF into a model.
Parameters:
  model -
Parameters:
  filenameOrURI -
Parameters:
  rdfSyntax - RDF Serialization syntax. The model or null, if there was an error.
exception:
  JenaException - if there is syntax error in file.



readModel
public Model readModel(Model model, String filenameOrURI, String baseURI, String syntax)(Code)
Read a file of RDF into a model.
Parameters:
  model -
Parameters:
  filenameOrURI -
Parameters:
  baseURI -
Parameters:
  syntax - The model
exception:
  JenaException - if there is syntax error in file.



readWholeFileAsUTF8
public String readWholeFileAsUTF8(InputStream in)(Code)
Slurp up a whole file



readWholeFileAsUTF8
public String readWholeFileAsUTF8(String filename)(Code)
Slurp up a whole file: map filename as necessary



remap
public String remap(String filenameOrURI)(Code)



remove
public void remove(Locator loc)(Code)
Remove a locator



removeCacheModel
public void removeCacheModel(String uri)(Code)



resetCache
public void resetCache()(Code)
Reset the model cache



setGlobalFileManager
public static void setGlobalFileManager(FileManager globalFileManager)(Code)
Set the global file manager (as returned by get()) If called before any call to get(), then the usual default filemanager is not created
Parameters:
  globalFileManager -



setLocationMapper
public void setLocationMapper(LocationMapper _mapper)(Code)
Set the location mapping



setMapper
public void setMapper(LocationMapper _mapper)(Code)



setModelCaching
public void setModelCaching(boolean state)(Code)
Change the state of model cache : does not clear the cache



setStdLocators
public static void setStdLocators(FileManager fMgr)(Code)
Force a file handler to have the default configuration.



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.