Creates a temporary file with text data to demonstrate uploading a file
to Amazon S3

@return A newly created temporary file with text data.

@throws IOException
17494
private static File createSampleFile() throws IOException {
        File file = File.createTempFile("aws-java-sdk-", ".txt");
        file.deleteOnExit();

        Writer writer = new OutputStreamWriter(new FileOutputStream(file));
        writer.write("abcdefghijklmnopqrstuvwxyz\n");
        writer.write("01234567890112345678901234\n");
        writer.write("!@#$%^&*()-=[]{};':',.<>/?\n");
        writer.write("01234567890112345678901234\n");
        writer.write("abcdefghijklmnopqrstuvwxyz\n");
        writer.close();

        return file;
    }
758489
public static File createTempDir() throws IllegalStateException
   {
      File baseDir = getTempDirectory();
      try
      {
         return Files.createTempDirectory(baseDir.toPath(), "tmpdir").toFile();
      }
      catch (IOException e)
      {
         throw new IllegalStateException("Error while creating temporary directory", e);
      }
   }
1354521
private void createOutputFile() throws IOException {
        this.fileChannel = Files.newByteChannel(Paths.get(filePath), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
    }
1135217
public File createArchive() throws IOException, ZipException {
		File tmpFile = File.createTempFile("dw-data", ".zip");
		try {
			tmpFile.delete();

			ZipFile zipFile = new ZipFile(tmpFile.getAbsoluteFile());
			ZipParameters parameters = new ZipParameters();
			parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_ULTRA);
			parameters.setIncludeRootFolder(false);
			zipFile.addFolder(tempDir.toFile(), parameters);

		} finally {
			dispose();
		}
		return tmpFile;
	}
790073
public static File createTempFile(final Framework framework) throws IOException {
        String fileExt = ".tmp";
        if ("windows".equalsIgnoreCase(framework.createFrameworkNode().getOsFamily())) {
            fileExt = ".tmp.bat";
        }
        final File dispatch = File.createTempFile("dispatch", fileExt, new File(framework.getProperty(
                "framework.tmp.dir")));
        registerTempFile(dispatch);
        return dispatch;
    }
745167
@Deprecated
    public static File createTempDirectory( final String    prefix )
        throws
            IOException
    {
        File tempDir;

        tempDir = File.createTempFile( prefix, null );

        if( ! ( tempDir.delete() ) )
        {
            throw new IOException( "Could not delete temp file: " + tempDir.getAbsolutePath() );
        }

        if( ! ( tempDir.mkdir() ) )
        {
            throw new IOException( "Could not create temp directory: " + tempDir.getAbsolutePath() );
        }

        return tempDir;
    }
563089
public static File copy(InputStream stream) throws IOException
  {
    File file = createTempFile();
    copy(stream, new FileOutputStream(file));
    return file;
  }
544471
public static RandomAccessFile createTemporaryFile
        (String prefix, String suffix) throws IOException {

        return createTemporaryFile(prefix, suffix, null);
    }
531861
public static SwapFile createTempFile(String prefix, String suffix, File directory) throws IOException
   {
      throw new IOException("Not applicable. Call get(File, String) method instead");
   }
649647
public synchronized File getTempDirectory() throws IOException {
        if (tempDirectory == null) {
            final File baseTemp = new File(getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir")));
            tempDirectory = FileUtils.createTempDirectory(baseTemp);
        }
        return tempDirectory;
    }
108744
@Override
  public void create()
    throws IOException
  {
    Files.createDirectories(_path.getParent());

    if (Files.exists(_path)) {
      throw new IOException(L.l("CREATE for path '{0}' failed, because the file already exists.  CREATE can not override an existing table.",
                                _path));
    }
    
    init();
    /*
    _channel = _path.openFileChannel(StandardOpenOption.CREATE, 
                                     StandardOpenOption.WRITE,
                                     StandardOpenOption.READ);
    
    setFileSize(_path.length());
    
    initImpl();
    */
  }
610251
@SuppressWarnings("static-method")
	protected File createTempDirectory() {
		final File tmpPath = new File(System.getProperty("java.io.tmpdir")); //$NON-NLS-1$
		int i = 0;
		File tmp = new File(tmpPath, "sarlc" + i); //$NON-NLS-1$
		while (tmp.exists()) {
			++i;
			tmp = new File(tmpPath, "sarlc" + i); //$NON-NLS-1$
		}
		return tmp;
	}
1301700
private Response make() throws IOException {
        if (this.zipped.isEmpty()) {
            this.zipped.add(
                new RsWithHeader(
                    new RsWithBody(
                        this.origin,
                        RsGzip.gzip(this.origin.body())
                    ),
                    "Content-Encoding",
                    "gzip"
                )
            );
        }
        return this.zipped.get(0);
    }
194091
protected String createFile() throws IOException {
        generateNewBasename();
        String name = currentBasename + '.' + this.extension  +
            ((settings.getCompress())? DOT_COMPRESSED_FILE_EXTENSION: "") +
            OCCUPIED_SUFFIX;
        File dir = getNextDirectory(settings.calcOutputDirs());
        return createFile(new File(dir, name));
    }
423938
public BufferedInputStream getInputStream() throws IORuntimeException {
		try {
			return new BufferedInputStream(new FileInputStream(this.file));
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
	}
1073757
public static synchronized File createSwapFile() throws IOException {
		File swapFile = createSwapFile(SWAP_FILE_PREFIX, SWAP_FILE_SUFFIX);
		// works reliably only on Unix platforms!
		swapFile.deleteOnExit();
		return swapFile;
	}
1011139
public static RandomAccessFile createTemporaryFile
        (String prefix, String suffix, File directory) throws IOException {

        File file = File.createTempFile(prefix, suffix, directory);
        file.deleteOnExit();
        return new TemporaryFile(file);
    }