// Path: src/main/java/com/rapid7/appspider/models/AuthenticationModel.java
// public class AuthenticationModel {
// 
//     private final String username;
//     private final String password;
//     private final Optional<String> clientId;
// 
//     /**
//      * instantiates a new instance of the {@code AuthenticationModel} class with no client Id
//      */
//     public AuthenticationModel(String username, String password) {
//         this(username, password, Optional.empty());
//     }
// 
//     /**
//      * instantiates a new instance of the {@code AuthenticationModel} class ensuring that
//      * username and password are both non-null and non-empty
//      */
//     public AuthenticationModel(String username, String password, Optional<String> clientId) {
//         if (username == null || username.isEmpty() || password == null || password.isEmpty()) {
//             throw new IllegalArgumentException();
//         }
//         this.username = username;
//         this.password = password;
//         this.clientId = clientId;
//     }
// 
//     /**
//      * gets the password value
//      * @return password as a {@code Secret}
//      */
//     public String getPassword() {
//         return password;
//     }
// 
//     /**
//      * Get the username value
//      * @return username as a String
//      */
//     public String getUsername() {
//         return username;
//     }
// 
//     /**
//      * Returns whether this object contains a clientId or not
//      * 
//      * <p>
//      * should be called prior to {@code getClientId} to ensure a value is present,
//      * otherwise an exception may occur
//      * </p>
//      * @return true if client id is set; otherwise, false
//      */
//     public boolean hasClientId() {
//         return clientId.isPresent();
//     }
// 
//     /**
//      * Gets the client id if present; otherwise throws a {@code NoSuchElementException}
//      * @return the client Id if present
//      * @throws NoSuchElementException if this instance does not have a clientId
//      */
//     public String getClientId() throws NoSuchElementException {
//         return clientId.orElseThrow(NoSuchElementException::new);
//     }
// 
// 
// }


import hudson.FilePath;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Objects;
import java.util.Optional;
import com.rapid7.appspider.models.AuthenticationModel;
            return true;
        } catch (IOException e) {
            log.println(e.toString());
            return false;
        }
    }
    private boolean saveInputStreamToFile(Path file, InputStream inputStream) {
        if (Objects.isNull(inputStream))
            return false;

        try {
            if (!Files.exists(file) )
                file = Files.createFile(file);

            try (InputStream bufferedInput = new BufferedInputStream(inputStream);
                 OutputStream outputStream = Files.newOutputStream(file)) {

                byte[] buffer = new byte[BUFFER_SIZE];
                int bytesRead = 0;
                while ((bytesRead = bufferedInput.read(buffer)) != -1) {
                   outputStream.write(buffer, 0, bytesRead);
                }
                outputStream.flush();
                return true;
            }
        } catch (IOException e) {
            log.println(e.toString());
            return false;
        }
    }
// Path: src/main/java/com/rapid7/appspider/models/AuthenticationModel.java
// public class AuthenticationModel {
// 
//     private final String username;
//     private final String password;
//     private final Optional<String> clientId;
// 
//     /**
//      * instantiates a new instance of the {@code AuthenticationModel} class with no client Id
//      */
//     public AuthenticationModel(String username, String password) {
//         this(username, password, Optional.empty());
//     }
// 
//     /**
//      * instantiates a new instance of the {@code AuthenticationModel} class ensuring that
//      * username and password are both non-null and non-empty
//      */
//     public AuthenticationModel(String username, String password, Optional<String> clientId) {
//         if (username == null || username.isEmpty() || password == null || password.isEmpty()) {
//             throw new IllegalArgumentException();
//         }
//         this.username = username;
//         this.password = password;
//         this.clientId = clientId;
//     }
// 
//     /**
//      * gets the password value
//      * @return password as a {@code Secret}
//      */
//     public String getPassword() {
//         return password;
//     }
// 
//     /**
//      * Get the username value
//      * @return username as a String
//      */
//     public String getUsername() {
//         return username;
//     }
// 
//     /**
//      * Returns whether this object contains a clientId or not
//      * 
//      * <p>
//      * should be called prior to {@code getClientId} to ensure a value is present,
//      * otherwise an exception may occur
//      * </p>
//      * @return true if client id is set; otherwise, false
//      */
//     public boolean hasClientId() {
//         return clientId.isPresent();
//     }
// 
//     /**
//      * Gets the client id if present; otherwise throws a {@code NoSuchElementException}
//      * @return the client Id if present
//      * @throws NoSuchElementException if this instance does not have a clientId
//      */
//     public String getClientId() throws NoSuchElementException {
//         return clientId.orElseThrow(NoSuchElementException::new);
//     }
// 
// 
// }


// Path: src/main/java/com/rapid7/appspider/Report.java
import hudson.FilePath;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Objects;
import java.util.Optional;
import com.rapid7.appspider.models.AuthenticationModel;

            return true;
        } catch (IOException e) {
            log.println(e.toString());
            return false;
        }
    }
    private boolean saveInputStreamToFile(Path file, InputStream inputStream) {
        if (Objects.isNull(inputStream))
            return false;

        try {
            if (!Files.exists(file) )
                file = Files.createFile(file);

            try (InputStream bufferedInput = new BufferedInputStream(inputStream);
                 OutputStream outputStream = Files.newOutputStream(file)) {

                byte[] buffer = new byte[BUFFER_SIZE];
                int bytesRead = 0;
                while ((bytesRead = bufferedInput.read(buffer)) != -1) {
                   outputStream.write(buffer, 0, bytesRead);
                }
                outputStream.flush();
                return true;
            }
        } catch (IOException e) {
            log.println(e.toString());
            return false;
        }
    }
    private String getNowAsFormattedString() {