Tabnine Logo
IO.createTempFile
Code IndexAdd Tabnine to your IDE (free)

How to use
createTempFile
method
in
aQute.lib.io.IO

Best Java code snippets using aQute.lib.io.IO.createTempFile (Showing top 15 results out of 315)

origin: org.osgi/osgi.enroute.web.simple.provider

private File setCompressor(CacheFile c, HttpServletResponse rsp, String type, FE<OutputStream,OutputStream> gen)
    throws Exception {
  rsp.setHeader("Content-Encoding", type);
  File f = new File(c.file.getParentFile(), c.file.getName() + "__" + type + "__");
  if (f.isFile() && f.lastModified() >= c.file.lastModified()) {
    return f;
  }
  File t = IO.createTempFile(c.file.getParentFile(), "tmp", "." + type);
  try (FileOutputStream fout = new FileOutputStream(t)) {
    try (OutputStream out = gen.get(fout);) {
      IO.copy(c.file, out);
      out.flush();
    }
  }
  Files.move(t.toPath(), f.toPath(), StandardCopyOption.REPLACE_EXISTING);
  t.renameTo(f);
  return f;
}
origin: biz.aQute.bnd/biz.aQute.bndlib

public void save(File location) throws IOException {
  if (location.getName()
    .endsWith(".gz"))
    compress = true;
  IO.mkdirs(location.getParentFile());
  File tmp = IO.createTempFile(location.getParentFile(), "index", ".xml");
  try (OutputStream out = IO.outputStream(tmp)) {
    save(out);
  }
  IO.rename(tmp, location);
}
origin: biz.aQute.bnd/biz.aQute.bnd

public void save(File location) throws IOException {
  if (location.getName()
    .endsWith(".gz"))
    compress = true;
  IO.mkdirs(location.getParentFile());
  File tmp = IO.createTempFile(location.getParentFile(), "index", ".xml");
  try (OutputStream out = IO.outputStream(tmp)) {
    save(out);
  }
  IO.rename(tmp, location);
}
origin: org.osgi/osgi.enroute.web.simple.provider

@Override
public File call() {
  try {
    String uri = URLDecoder.decode(path.substring(1), "UTF-8");
    URL url = new URL(uri);
    URLConnection con = url.openConnection();
    con.setConnectTimeout(10000);
    con.setRequestProperty("Accept-Encoding", "deflate, gzip");
    File tmp = IO.createTempFile(cacheFile, "path", ".tmp");
    InputStream in = con.getInputStream();
    String encoding = con.getContentEncoding();
    if ("deflate".equalsIgnoreCase(encoding)) {
      in = new DeflaterInputStream(in);
    } else if ("gzip".equalsIgnoreCase(encoding)) {
      in = new ZipInputStream(in);
    }
    IO.copy(in, tmp);
    IO.rename(tmp, cached);
    cached.setLastModified(con.getLastModified() + 1000);
    return cached;
  }
  catch (Exception e) {
    throw new RuntimeException(new InternalServer500Exception(e));
  }
}
origin: biz.aQute.bnd/biz.aQute.bndlib

void download0(URI url, File path, byte[] sha) throws Exception {
  IO.mkdirs(path.getParentFile());
  File tmp = IO.createTempFile(path.getParentFile(), "tmp", ".jar");
  URL u = url.toURL();
origin: biz.aQute.bnd/biz.aQute.bnd

void download0(URI url, File path, byte[] sha) throws Exception {
  IO.mkdirs(path.getParentFile());
  File tmp = IO.createTempFile(path.getParentFile(), "tmp", ".jar");
  URL u = url.toURL();
origin: biz.aQute.bnd/biz.aQute.bnd

tmpFile = IO.createTempFile(storageDir, "put", ".bnd");
IO.copy(dis, tmpFile);
origin: biz.aQute.bnd/biz.aQute.repository

tmpFile = IO.createTempFile(storageDir, "put", ".bnd");
IO.copy(dis, tmpFile);
origin: biz.aQute.bnd/bnd

void download0(URI url, File path, byte[] sha) throws Exception {
  path.getParentFile().mkdirs();
  File tmp = IO.createTempFile(path.getParentFile(), "tmp", ".jar");
  URL u = url.toURL();
origin: biz.aQute.bnd/bndlib

void download0(URI url, File path, byte[] sha) throws Exception {
  path.getParentFile().mkdirs();
  File tmp = IO.createTempFile(path.getParentFile(), "tmp", ".jar");
  URL u = url.toURL();
origin: biz.aQute.bnd/biz.aQute.bndlib

File tmpFile = IO.createTempFile(root, "put", ".jar");
try (DigestInputStream dis = new DigestInputStream(stream, MessageDigest.getInstance("SHA-1"))) {
  IO.copy(dis, tmpFile);
origin: biz.aQute.bnd/biz.aQute.bnd

File tmpFile = IO.createTempFile(root, "put", ".jar");
try (DigestInputStream dis = new DigestInputStream(stream, MessageDigest.getInstance("SHA-1"))) {
  IO.copy(dis, tmpFile);
origin: biz.aQute/bndlib

File tmpFile = IO.createTempFile(root, "put", ".jar");
try {
  DigestInputStream dis = new DigestInputStream(stream, MessageDigest.getInstance("SHA-1"));
origin: biz.aQute.bnd/bndlib

File tmpFile = IO.createTempFile(root, "put", ".jar");
try {
  DigestInputStream dis = new DigestInputStream(stream, MessageDigest.getInstance("SHA-1"));
origin: biz.aQute.bnd/bnd

File tmpFile = IO.createTempFile(root, "put", ".jar");
try {
  DigestInputStream dis = new DigestInputStream(stream, MessageDigest.getInstance("SHA-1"));
aQute.lib.ioIOcreateTempFile

Javadoc

Create a temporary file.

Popular methods of IO

  • copy
  • collect
  • getFile
  • deleteWithException
    Deletes the specified path. Folders are recursively deleted. Throws exception if any of the files co
  • reader
  • store
  • writer
  • delete
    Deletes the specified path. Folders are recursively deleted. If file(s) cannot be deleted, no feedba
  • read
  • rename
    Renames from to to replacing the target file if necessary.
  • isSymbolicLink
  • stream
  • isSymbolicLink,
  • stream,
  • traverse,
  • close,
  • createSymbolicLink,
  • createSymbolicLinkOrCopy,
  • decode,
  • mkdirs,
  • normalizePath

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Runner (org.openjdk.jmh.runner)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now