/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A subclass of JavaFileObject representing regular files.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
/** Have the parent directories been created?
*/
private boolean hasParents = false;
this(fileManager, f.getName(), f);
}
super(fileManager);
if (f.isDirectory()) {
throw new IllegalArgumentException("directories not supported");
}
this.file = f;
}
}
}
return name;
}
}
return new FileInputStream(file);
}
fileManager.flushCache(this);
return new FileOutputStream(file);
}
try {
try {
} finally {
}
if (!ignoreEncodingErrors) {
}
} finally {
}
}
return cb;
}
fileManager.flushCache(this);
}
public long getLastModified() {
return file.lastModified();
}
public boolean delete() {
}
}
//System.err.println("RegularFileObject " + file + " " +r.getPath());
//System.err.println("dir: " + dir);
}
}
return null;
}
// null check
return false;
}
return true;
}
if (name.equalsIgnoreCase(n)) {
try {
// allow for Windows
} catch (IOException e) {
}
}
return false;
}
if (!hasParents) {
throw new IOException("could not create parent directories");
}
}
}
hasParents = true;
}
}
/**
* Check if two file objects are equal.
* Two RegularFileObjects are equal if the absolute paths of the underlying
* files are equal.
*/
if (this == other)
return true;
if (!(other instanceof RegularFileObject))
return false;
}
public int hashCode() {
return getAbsoluteFile().hashCode();
}
}
return absFile;
}
}