View Javadoc
1   // Generated by delombok at Mon Apr 14 16:48:01 UTC 2025
2   package de.larssh.jes.parser;
3   
4   import java.io.NotSerializableException;
5   import java.io.ObjectInputStream;
6   import java.io.ObjectOutputStream;
7   import org.apache.commons.net.ftp.FTPFile;
8   import de.larssh.jes.Job;
9   import de.larssh.utils.annotations.SuppressJacocoGenerated;
10  import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
11  
12  /**
13   * {@link FTPFile} implementation to hold a {@link Job} object.
14   */
15  public class JesFtpFile extends FTPFile {
16  	/**
17  	 * Job details
18  	 */
19  	private final transient Job job;
20  
21  	/**
22  	 * Creates a file containing a {@link Job} object and sets the original FTP
23  	 * server raw listing from which the job was created.
24  	 *
25  	 * @param job        job details
26  	 * @param rawListing raw FTP server listing
27  	 */
28  	@SuppressWarnings("PMD.ConstructorCallsOverridableMethod")
29  	public JesFtpFile(final Job job, final String rawListing) {
30  		this.job = job;
31  		setRawListing(rawListing);
32  	}
33  
34  	/**
35  	 * This class cannot be deserialized.
36  	 *
37  	 * @param stream object input stream
38  	 * @throws NotSerializableException This class cannot be deserialized.
39  	 */
40  	@SuppressJacocoGenerated(justification = "this is not serializable")
41  	@SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_READ_OBJECT", justification = "Class.getName() cannot be overridden")
42  	private void readObject(@SuppressWarnings("unused") final ObjectInputStream stream) throws NotSerializableException {
43  		throw new NotSerializableException(JesFtpFile.class.getName());
44  	}
45  
46  	/**
47  	 * This class cannot be serialized.
48  	 *
49  	 * @param stream object output stream
50  	 * @throws NotSerializableException This class cannot be serialized.
51  	 */
52  	@SuppressJacocoGenerated(justification = "this is not serializable")
53  	private void writeObject(@SuppressWarnings("unused") final ObjectOutputStream stream) throws NotSerializableException {
54  		throw new NotSerializableException(JesFtpFile.class.getName());
55  	}
56  
57  	/**
58  	 * Job details
59  	 *
60  	 * @return job details
61  	 */
62  	@java.lang.SuppressWarnings("all")
63  	@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
64  	@lombok.Generated
65  	public Job getJob() {
66  		return this.job;
67  	}
68  
69  	@edu.umd.cs.findbugs.annotations.NonNull
70  	@java.lang.Override
71  	@java.lang.SuppressWarnings("all")
72  	@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
73  	@lombok.Generated
74  	public java.lang.String toString() {
75  		return "JesFtpFile(job=" + this.getJob() + ")";
76  	}
77  }