1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.aether.spi.connector;
20
21 import java.io.File;
22
23 import org.eclipse.aether.RequestTrace;
24 import org.eclipse.aether.artifact.Artifact;
25 import org.eclipse.aether.transfer.ArtifactTransferException;
26 import org.eclipse.aether.transfer.TransferListener;
27 import org.eclipse.aether.transform.FileTransformer;
28
29
30
31
32
33 public final class ArtifactUpload extends ArtifactTransfer {
34 private FileTransformer fileTransformer;
35
36
37
38
39 public ArtifactUpload() {
40
41 }
42
43
44
45
46
47
48
49 public ArtifactUpload(Artifact artifact, File file) {
50 setArtifact(artifact);
51 setFile(file);
52 }
53
54
55
56
57
58
59
60
61
62
63
64
65 public ArtifactUpload(Artifact artifact, File file, FileTransformer fileTransformer) {
66 setArtifact(artifact);
67 setFile(file);
68 setFileTransformer(fileTransformer);
69 }
70
71 @Override
72 public ArtifactUpload setArtifact(Artifact artifact) {
73 super.setArtifact(artifact);
74 return this;
75 }
76
77 @Override
78 public ArtifactUpload setFile(File file) {
79 super.setFile(file);
80 return this;
81 }
82
83 @Override
84 public ArtifactUpload setException(ArtifactTransferException exception) {
85 super.setException(exception);
86 return this;
87 }
88
89 @Override
90 public ArtifactUpload setListener(TransferListener listener) {
91 super.setListener(listener);
92 return this;
93 }
94
95 @Override
96 public ArtifactUpload setTrace(RequestTrace trace) {
97 super.setTrace(trace);
98 return this;
99 }
100
101 public ArtifactUpload setFileTransformer(FileTransformer fileTransformer) {
102 this.fileTransformer = fileTransformer;
103 return this;
104 }
105
106 public FileTransformer getFileTransformer() {
107 return fileTransformer;
108 }
109
110 @Override
111 public String toString() {
112 if (getFileTransformer() != null) {
113 return getArtifact() + " >>> " + getFileTransformer().transformArtifact(getArtifact()) + " - " + getFile();
114 } else {
115 return getArtifact() + " - " + getFile();
116 }
117 }
118 }