/*
* 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.
*/
/**
* Helper class to support creation of temporary files and directories with
* initial attributes.
*/
class TempFileHelper {
private TempFileHelper() { }
// temporary directory location
private static final boolean isPosix =
// file name generation, same as java.io.File for now
// the generated name should be a simple file name
throw new IllegalArgumentException("Invalid prefix or suffix");
}
// default file and directory permissions (lazily initialized)
private static class PosixPermissions {
}
/**
* Creates a file or directory in in the given given directory (or in the
* temporary directory if dir is {@code null}).
*/
boolean createDirectory,
throws IOException
{
prefix = "";
// in POSIX environments use default file and directory permissions
// if initial permissions not given by caller.
// no attributes so use default permissions
} else {
// check if posix permissions given; if not use default
boolean hasPermissions = false;
hasPermissions = true;
break;
}
}
if (!hasPermissions) {
}
}
}
// loop generating random names until file or directory can be created
for (;;) {
Path f;
try {
} catch (InvalidPathException e) {
// don't reveal temporary directory location
throw new IllegalArgumentException("Invalid prefix or suffix");
throw e;
}
try {
if (createDirectory) {
} else {
}
} catch (SecurityException e) {
// don't reveal temporary directory location
throw new SecurityException("Unable to create temporary file or directory");
throw e;
} catch (FileAlreadyExistsException e) {
// ignore
}
}
}
/**
* Creates a temporary file in the given directory, or in in the
* temporary directory if dir is {@code null}.
*/
throws IOException
{
}
/**
* Creates a temporary directory in the given directory, or in in the
* temporary directory if dir is {@code null}.
*/
throws IOException
{
}
}