*** empty log message ***
This commit is contained in:
		
							parent
							
								
									2b97e4dec2
								
							
						
					
					
						commit
						a283adba4a
					
				
					 1 changed files with 0 additions and 46 deletions
				
			
		|  | @ -1,46 +0,0 @@ | |||
| // NodeDataSource.java | ||||
| // Copyright (c) Hannes Wallnöfer 1999-2000 | ||||
| 
 | ||||
| package helma.objectmodel; | ||||
| 
 | ||||
| import javax.activation.*; | ||||
| import java.io.*; | ||||
| 
 | ||||
| /** | ||||
|  * Makes Nodes usable as Datasources in the Java Activation Framework (JAF) | ||||
|  */ | ||||
| 
 | ||||
| public class NodeDataSource implements DataSource { | ||||
| 
 | ||||
|     private INode node; | ||||
|     private String name; | ||||
| 
 | ||||
|     public NodeDataSource (INode node) { | ||||
|         this.node = node; | ||||
|         this.name = node.getName (); | ||||
|     } | ||||
| 
 | ||||
|     public NodeDataSource (INode node, String name) { | ||||
|         this.node = node; | ||||
|         this.name = name; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public InputStream getInputStream() throws IOException { | ||||
|         return new ByteArrayInputStream(node.getContent ()); | ||||
|     } | ||||
| 
 | ||||
|     public OutputStream getOutputStream () throws IOException { | ||||
|         throw new IOException ("Can't write to Node object."); | ||||
|     } | ||||
| 
 | ||||
|     public String getContentType() { | ||||
|         return node.getContentType (); | ||||
|     } | ||||
| 
 | ||||
|     public String getName() | ||||
|     { | ||||
|         return name; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue