-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Description
No matter what I entered for this parameter, it still generates a temporary file name for the S3 bucket.
private RevisionLocation zipAndUpload(AWSClients aws, String projectName, FilePath sourceDirectory) throws IOException, InterruptedException, IllegalArgumentException {
File zipFile = null;
File versionFile;
versionFile = new File(sourceDirectory + "/" + versionFileName);
InputStreamReader reader = null;
String version = null;
try {
reader = new InputStreamReader(new FileInputStream(versionFile), "UTF-8");
char[] chars = new char[(int) versionFile.length() -1];
reader.read(chars);
version = new String(chars);
reader.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if(reader !=null){reader.close();}
}
if (version != null){
zipFile = new File("/tmp/" + projectName + "-" + version + ".zip");
final boolean fileCreated = zipFile.createNewFile();
if (!fileCreated) {
logger.println("File already exists, overwriting: " + zipFile.getPath());
}
} else {
zipFile = File.createTempFile(projectName + "-", ".zip");
}
Metadata
Metadata
Assignees
Labels
No labels