Пример #1
0
 public File asFile(String charset) {
   File file = tempFileProvider.createTemporaryFile("string", ".txt", "resource");
   try {
     Files.write(string, file, Charset.forName(charset));
   } catch (IOException e) {
     throw new ResourceException(
         "Could not write " + getDisplayName() + " content to " + file + ".", e);
   }
   return file;
 }
 private synchronized DefaultBinaryStore createBinaryStore(String storeKey) {
   DefaultBinaryStore store = stores.get(storeKey);
   if (store == null || isFull(store)) {
     File storeFile = temp.createTemporaryFile("gradle", ".bin");
     storeFile.deleteOnExit();
     store = new DefaultBinaryStore(storeFile);
     stores.put(storeKey, store);
     cleanUpLater.add(store);
   }
   return store;
 }