Skip to content

Commit 52e211b

Browse files
create tmp manifest file in same dir as dest to avoid issues with cross filesystem renameTo
1 parent ee25573 commit 52e211b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

google-cloud-testing/google-cloud-gcloud-maven-plugin/src/main/java/com/google/cloud/DownloadComponentsMojo.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ private void updateCachedManifest() throws IOException {
177177

178178
getLog().debug("Downloading fresh manifest");
179179

180-
File tempFile = File.createTempFile(localCache.getName(), "");
180+
File tempFile = new File(localCache.toString() + ".tmp");
181+
tempFile.createNewFile();
181182

182183
try (BufferedInputStream in = new BufferedInputStream(manifestUrl.openStream());
183-
FileOutputStream fileOutputStream = new FileOutputStream(tempFile)) {
184+
FileOutputStream fileOutputStream = new FileOutputStream(tempFile, false)) {
184185
byte dataBuffer[] = new byte[1024];
185186
int bytesRead;
186187
while ((bytesRead = in.read(dataBuffer, 0, 1024)) != -1) {

0 commit comments

Comments
 (0)