1 19 package org.netbeans.modules.xml.catalog.lib; 20 21 import java.io.*; 22 import java.net.*; 23 import java.util.*; 24 25 import org.openide.text.*; 26 import org.openide.ErrorManager; 27 28 29 36 public abstract class URLEnvironment implements CloneableEditorSupport.Env { 37 38 39 private static final long serialVersionUID =9098933339895727443L; 40 41 private final URL peer; 42 43 private transient Date modified; 44 45 46 public URLEnvironment(URL url) { 47 if (url == null) throw new NullPointerException (); 48 peer = url; 49 modified = new Date(); 50 } 51 52 public void markModified() throws java.io.IOException { 53 throw new IOException("r/o"); } 55 56 public void unmarkModified() { 57 } 58 59 public void removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener) { 60 } 61 62 public boolean isModified() { 63 return false; 64 } 65 66 public java.util.Date getTime() { 67 return modified; 68 } 69 70 public void removeVetoableChangeListener(java.beans.VetoableChangeListener vetoableChangeListener) { 71 } 72 73 public boolean isValid() { 74 return true; 75 } 76 77 public java.io.OutputStream outputStream() throws java.io.IOException { 78 throw new IOException("r/o"); } 80 81 84 public java.lang.String getMimeType() { 85 return "text/xml"; } 87 88 91 public java.io.InputStream inputStream() throws java.io.IOException { 92 try { 93 return peer.openStream(); 94 } catch (IOException ex) { 95 ErrorManager err = ErrorManager.getDefault(); 98 err.annotate(ex, ErrorManager.USER, null, null, null, null); 99 throw ex; 100 } 101 } 102 103 public void addVetoableChangeListener(java.beans.VetoableChangeListener vetoableChangeListener) { 104 } 105 106 public void addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener) { 107 } 108 109 } 110 | Popular Tags |