1 19 20 package org.netbeans.modules.masterfs; 21 22 import org.openide.filesystems.*; 23 24 import java.io.FileNotFoundException ; 25 import java.io.IOException ; 26 import java.io.InputStream ; 27 import java.io.OutputStream ; 28 import java.util.Date ; 29 import java.util.Enumeration ; 30 31 35 class InvalidDummy extends BasedOnResourcePath { 36 37 static final long serialVersionUID = -1244651321997356809L; 38 39 protected InvalidDummy(ResourcePath resourcePath) { 40 super (resourcePath); 41 } 42 43 public FileSystem getFileSystem() throws FileStateInvalidException { 44 throw new FileStateInvalidException(getPath()); 45 } 46 47 public void rename(FileLock lock, String name, String ext) throws IOException { 48 throw new IOException (getPath()); 49 } 50 51 52 public void delete(FileLock lock) throws IOException { 53 throw new IOException (getPath()); 54 } 55 56 public InputStream getInputStream() throws FileNotFoundException { 57 throw new FileNotFoundException (getPath()); 58 } 59 60 public OutputStream getOutputStream(FileLock lock) throws IOException { 61 throw new IOException (getPath()); 62 } 63 64 public FileLock lock() throws IOException { 65 throw new IOException (getPath()); 66 } 67 68 public FileObject createFolder(String name) throws IOException { 69 throw new IOException (getPath()); 70 } 71 72 public FileObject createData(String name, String ext) throws IOException { 73 throw new IOException (getPath()); 74 } 75 76 77 public Object getAttribute(String attrName) { 78 return null; 79 } 80 81 public void setAttribute(String attrName, Object value) throws IOException { 82 throw new IOException (getPath()); 83 } 84 85 public Enumeration getAttributes() { 86 return org.openide.util.Enumerations.empty(); 87 } 88 89 public void addFileChangeListener(FileChangeListener fcl) { 90 } 91 92 public void removeFileChangeListener(FileChangeListener fcl) { 93 } 94 95 public long getSize() { 96 return 0; 97 } 98 99 public void setImportant(boolean b) { 100 } 101 102 public FileObject[] getChildren() { 103 return new FileObject[]{}; 104 } 105 106 public FileObject getFileObject(String name, String ext) { 107 return null; 108 } 109 110 111 public boolean isReadOnly() { 112 return true; 113 } 114 115 public FileObject getParent() { 116 return null; 117 } 118 119 public boolean isFolder() { 120 return false; 121 } 122 123 public Date lastModified() { 124 if (isRoot()) 125 return new Date (0); 126 return new java.util.Date (); 127 } 128 129 public boolean isData() { 130 return true; 131 } 132 133 public boolean isValid() { 134 return false; 135 } 136 137 public String getMIMEType() { 138 return "content/unknown"; } 140 141 } 142 | Popular Tags |