/** * Prepares to perform a download of objects from S3 by prompting the user for a directory * to store the files in, then performing the download. * * @throws IOException */ private void downloadSelectedObjects() throws IOException { // Prompt user to choose directory location for downloaded files (or cancel download altogether) JFileChooser fileChooser = new JFileChooser(); fileChooser.setDialogTitle("Choose directory to save S3 files in"); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fileChooser.setMultiSelectionEnabled(false); fileChooser.setSelectedFile(downloadDirectory); int returnVal = fileChooser.showDialog(ownerFrame, "Choose Directory"); if (returnVal != JFileChooser.APPROVE_OPTION) { return; } downloadDirectory = fileChooser.getSelectedFile(); prepareForObjectsDownload(); }
/** * Prepares to perform a download of objects from S3 by prompting the user for a directory * to store the files in, then performing the download. * * @throws IOException */ private void downloadSelectedObjects() throws IOException { // Prompt user to choose directory location for downloaded files (or cancel download altogether) JFileChooser fileChooser = new JFileChooser(); fileChooser.setDialogTitle("Choose directory to save S3 files in"); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fileChooser.setMultiSelectionEnabled(false); fileChooser.setSelectedFile(downloadDirectory); int returnVal = fileChooser.showDialog(ownerFrame, "Choose Directory"); if (returnVal != JFileChooser.APPROVE_OPTION) { return; } downloadDirectory = fileChooser.getSelectedFile(); prepareForObjectsDownload(); }