/** * Produce a Java IO mode string from the flags in this object. * * @return A Java string suitable for opening files with RandomAccessFile */ public String toJavaModeString() { // Do not open as 'rw' by default since a file with read-only permissions will fail on 'rw' if (isWritable() || isCreate() || isTruncate()) { // Java requires "w" for creating a file that does not exist return "rw"; } else { return "r"; } }
/** * Produce a Java IO mode string from the flags in this object. * * @return A Java string suitable for opening files with RandomAccessFile */ public String toJavaModeString() { // Do not open as 'rw' by default since a file with read-only permissions will fail on 'rw' if (isWritable() || isCreate() || isTruncate()) { // Java requires "w" for creating a file that does not exist return "rw"; } else { return "r"; } }
/** * Produce a Java IO mode string from the flags in this object. * * @return A Java string suitable for opening files with RandomAccessFile */ public String toJavaModeString() { // Do not open as 'rw' by default since a file with read-only permissions will fail on 'rw' if (isWritable() || isCreate() || isTruncate()) { // Java requires "w" for creating a file that does not exist return "rw"; } else { return "r"; } }
/** * Produce a Java IO mode string from the flags in this object. * * @return A Java string suitable for opening files with RandomAccessFile */ public String toJavaModeString() { // Do not open as 'rw' by default since a file with read-only permissions will fail on 'rw' if (isWritable() || isCreate() || isTruncate()) { // Java requires "w" for creating a file that does not exist return "rw"; } else { return "r"; } }
@Override public String toString() { StringBuilder buf = new StringBuilder("ModeFlags(" + flags + "): "); if (isAppendable()) buf.append("APPENDABLE "); if (isBinary()) buf.append("BINARY "); if (isCreate()) buf.append("CREATE "); if (isExclusive()) buf.append("EXCLUSIVE "); if (isReadOnly()) buf.append("READONLY "); if (isText()) buf.append("TEXT "); if (isTruncate()) buf.append("TRUNCATE "); if (isWritable()) { if (isReadable()) { buf.append("RDWR"); } else { buf.append("WRITABLE "); } } return buf.toString(); }
@Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append("ModeFlags(").append(flags).append("): "); if (isAppendable()) buf.append("APPENDABLE "); if (isBinary()) buf.append("BINARY "); if (isCreate()) buf.append("CREATE "); if (isExclusive()) buf.append("EXCLUSIVE "); if (isReadOnly()) buf.append("READONLY "); if (isText()) buf.append("TEXT "); if (isTemporary()) buf.append("TMPFILE "); if (isTruncate()) buf.append("TRUNCATE "); if (isWritable()) { if (isReadable()) { buf.append("RDWR"); } else { buf.append("WRITABLE "); } } return buf.toString(); }
@Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append("ModeFlags(").append(flags).append("): "); if (isAppendable()) buf.append("APPENDABLE "); if (isBinary()) buf.append("BINARY "); if (isCreate()) buf.append("CREATE "); if (isExclusive()) buf.append("EXCLUSIVE "); if (isReadOnly()) buf.append("READONLY "); if (isText()) buf.append("TEXT "); if (isTemporary()) buf.append("TMPFILE "); if (isTruncate()) buf.append("TRUNCATE "); if (isWritable()) { if (isReadable()) { buf.append("RDWR"); } else { buf.append("WRITABLE "); } } return buf.toString(); }
@Override public String toString() { StringBuilder buf = new StringBuilder("ModeFlags(" + flags + "): "); if (isAppendable()) buf.append("APPENDABLE "); if (isBinary()) buf.append("BINARY "); if (isCreate()) buf.append("CREATE "); if (isExclusive()) buf.append("EXCLUSIVE "); if (isReadOnly()) buf.append("READONLY "); if (isText()) buf.append("TEXT "); if (isTruncate()) buf.append("TRUNCATE "); if (isWritable()) { if (isReadable()) { buf.append("RDWR"); } else { buf.append("WRITABLE "); } } return buf.toString(); }
if (flags.isCreate()) { try { fileCreated = theFile.createNewFile();
if (flags.isCreate()) { try { fileCreated = theFile.createNewFile();
if (modes.isCreate()) { if (theFile.exists() && modes.isExclusive()) { throw runtime.newErrnoEEXISTError("File exists - " + path);
if (modes.isCreate()) { if (theFile.exists() && modes.isExclusive()) { throw runtime.newErrnoEEXISTError("File exists - " + path);
if (modes.isCreate()) { if (theFile.exists() && modes.isExclusive()) { throw runtime.newErrnoEEXISTError("File exists - " + path);
if (modes.isCreate()) { if (theFile.exists() && modes.isExclusive()) { throw runtime.newErrnoEEXISTError("File exists - " + path);
if (modeFlags.isCreate()) { boolean fileCreated; try {
if (modeFlags.isCreate()) { boolean fileCreated; try {