test/tools/javac/diags/FileManager.java

changeset 708
c8b4a1e76089
parent 610
3640b60bd0f6
child 2525
2eb010b6cb22
equal deleted inserted replaced
707:33603a5fa84d 708:c8b4a1e76089
175 public boolean delete() { 175 public boolean delete() {
176 return delegate.delete(); 176 return delegate.delete();
177 } 177 }
178 178
179 void checkRead() throws IOException { 179 void checkRead() throws IOException {
180 if (cantRead != null && cantRead.matcher(getName()).matches()) 180 String canonName = getName().replace(File.separatorChar, '/');
181 if (cantRead != null && cantRead.matcher(canonName).matches())
181 throw new IOException("FileManager: Can't read"); 182 throw new IOException("FileManager: Can't read");
182 } 183 }
183 184
184 void checkWrite() throws IOException { 185 void checkWrite() throws IOException {
185 if (cantWrite != null && cantWrite.matcher(getName()).matches()) 186 String canonName = getName().replace(File.separatorChar, '/');
187 if (cantWrite != null && cantWrite.matcher(canonName).matches())
186 throw new IOException("FileManager: Can't write"); 188 throw new IOException("FileManager: Can't write");
187 } 189 }
188 190
189 JavaFileObject delegate; 191 JavaFileObject delegate;
190 } 192 }

mercurial