Skip to content

Commit 79e7610

Browse files
EvgenyB1001iText-CI
authored andcommitted
Fix PdfFileSpec javadoc warnings
DEVSIX-4122
1 parent 4928dcc commit 79e7610

File tree

1 file changed

+121
-81
lines changed

1 file changed

+121
-81
lines changed

kernel/src/main/java/com/itextpdf/kernel/pdf/filespec/PdfFileSpec.java

Lines changed: 121 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,19 @@ public static PdfFileSpec createExternalFileSpec(PdfDocument doc, String filePat
100100
}
101101

102102
/**
103-
* Embed a file to a PdfDocument.
103+
* Create an embedded file specification.
104104
*
105-
* @param doc PdfDocument to add the file to
105+
* @param doc {@link PdfDocument} instance to make this file specification indirect
106106
* @param fileStore byte[] containing the file
107107
* @param description file description
108108
* @param fileDisplay actual file name stored in the pdf
109-
* @param mimeType mime-type of the file
110-
* @param fileParameter Pdfdictionary containing fil parameters
111-
* @param afRelationshipValue AFRelationship key value, @see AFRelationshipValue. If <CODE>null</CODE>, @see AFRelationshipValue.Unspecified will be added.
112-
* @return PdfFileSpec containing the file specification of the file as Pdfobject
109+
* @param mimeType subtype of the embedded file. The value of this entry shall conform
110+
* to the MIME media type names
111+
* @param fileParameter {@link PdfDictionary} containing fil parameters
112+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document
113+
* that refers to this file specification and the associated file. If <CODE>null</CODE>,
114+
* {@link PdfName#Unspecified} will be added.
115+
* @return {@link PdfFileSpec} containing the file specification of the file
113116
*/
114117
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String description, String fileDisplay, PdfName mimeType, PdfDictionary fileParameter, PdfName afRelationshipValue) {
115118
PdfStream stream = (PdfStream)new PdfStream(fileStore).makeIndirect(doc);
@@ -128,73 +131,85 @@ public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileSto
128131
}
129132

130133
/**
131-
* Embed a file to a PdfDocument.
134+
* Create an embedded file specification.
132135
*
133-
* @param doc PdfDocument to add the file to
136+
* @param doc {@link PdfDocument} instance to make this file specification indirect
134137
* @param fileStore byte[] containing the file
135138
* @param fileDisplay actual file name stored in the pdf
136-
* @param fileParameter Pdfdictionary containing fil parameters
137-
* @param afRelationshipValue AFRelationship key value, @see AFRelationshipValue. If <CODE>null</CODE>, @see AFRelationshipValue.Unspecified will be added.
138-
* @return PdfFileSpec containing the file specification of the file as Pdfobject
139+
* @param fileParameter {@link PdfDictionary} containing fil parameters
140+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document
141+
* that refers to this file specification and the associated file. If <CODE>null</CODE>,
142+
* {@link PdfName#Unspecified} will be added.
143+
* @return {@link PdfFileSpec} containing the file specification of the file
139144
*/
140145
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String description, String fileDisplay, PdfDictionary fileParameter, PdfName afRelationshipValue) {
141146
return createEmbeddedFileSpec(doc, fileStore, description, fileDisplay, null, fileParameter, afRelationshipValue);
142147
}
143148

144149

145150
/**
146-
* Embed a file to a PdfDocument.
151+
* Create an embedded file specification.
147152
*
148-
* @param doc PdfDocument to add the file to
153+
* @param doc {@link PdfDocument} instance to make this file specification indirect
149154
* @param fileStore byte[] containing the file
150155
* @param fileDisplay actual file name stored in the pdf
151-
* @param fileParameter Pdfdictionary containing fil parameters
152-
* @param afRelationshipValue AFRelationship key value, @see AFRelationshipValue. If <CODE>null</CODE>, @see AFRelationshipValue.Unspecified will be added.
153-
* @return PdfFileSpec containing the file specification of the file as Pdfobject
156+
* @param fileParameter {@link PdfDictionary} containing fil parameters
157+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
158+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
159+
* {@link PdfName#Unspecified} will be added.
160+
* @return {@link PdfFileSpec} containing the file specification of the file
154161
*/
155162
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String fileDisplay, PdfDictionary fileParameter, PdfName afRelationshipValue) {
156163
return createEmbeddedFileSpec(doc, fileStore, null, fileDisplay, null, fileParameter, afRelationshipValue);
157164
}
158165

159166
/**
160-
* Embed a file to a PdfDocument.
167+
* Create an embedded file specification.
161168
*
162-
* @param doc PdfDocument to add the file to
169+
* @param doc {@link PdfDocument} instance to make this file specification indirect
163170
* @param fileStore byte[] containing the file
164171
* @param fileDisplay actual file name stored in the pdf
165-
* @param afRelationshipValue AFRelationship key value, @see AFRelationshipValue. If <CODE>null</CODE>, @see AFRelationshipValue.Unspecified will be added.
166-
* @return PdfFileSpec containing the file specification of the file as Pdfobject
172+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
173+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
174+
* {@link PdfName#Unspecified} will be added.
175+
* @return {@link PdfFileSpec} containing the file specification of the file
167176
*/
168177
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String fileDisplay, PdfName afRelationshipValue) {
169178
return createEmbeddedFileSpec(doc, fileStore, null, fileDisplay, null, null, afRelationshipValue);
170179
}
171180

172181
/**
173-
* Embed a file to a PdfDocument.
182+
* Create an embedded file specification.
174183
*
175-
* @param doc PdfDocument to add the file to
184+
* @param doc {@link PdfDocument} instance to make this file specification indirect
176185
* @param fileStore byte[] containing the file
177186
* @param description file description
178187
* @param fileDisplay actual file name stored in the pdf
179-
* @param afRelationshipValue AFRelationship key value, @see AFRelationshipValue. If <CODE>null</CODE>, @see AFRelationshipValue.Unspecified will be added.
180-
* @return PdfFileSpec containing the file specification of the file as Pdfobject
188+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
189+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
190+
* {@link PdfName#Unspecified} will be added.
191+
* @return {@link PdfFileSpec} containing the file specification of the file
181192
*/
182193
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, byte[] fileStore, String description, String fileDisplay, PdfName afRelationshipValue) {
183194
return createEmbeddedFileSpec(doc, fileStore, description, fileDisplay, null, null, afRelationshipValue);
184195
}
185196

186197

187198
/**
188-
* Embed a file to a PdfDocument.
199+
* Create an embedded file specification.
189200
*
190-
* @param doc
191-
* @param filePath
192-
* @param description
193-
* @param fileDisplay
194-
* @param mimeType
195-
* @param fileParameter
196-
* @param afRelationshipValue
197-
* @throws IOException
201+
* @param doc {@link PdfDocument} instance to make this file specification indirect
202+
* @param filePath file specification string, describing the path to the file to embed
203+
* @param description file description
204+
* @param fileDisplay actual file name stored in the pdf
205+
* @param mimeType subtype of the embedded file. The value of this entry shall conform
206+
* to the MIME media type names
207+
* @param fileParameter dictionary with file parameters
208+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
209+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
210+
* {@link PdfName#Unspecified} will be added.
211+
* @return {@link PdfFileSpec} containing the file specification of the file
212+
* @throws IOException if there are errors while creating an URL from the passed file path.
198213
*/
199214
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, String filePath, String description, String fileDisplay, PdfName mimeType, PdfDictionary fileParameter, PdfName afRelationshipValue) throws IOException {
200215
PdfStream stream = new PdfStream(doc, UrlUtil.toURL(filePath).openStream());
@@ -210,57 +225,71 @@ public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, String filePat
210225
}
211226

212227
/**
213-
* Embed a file to a PdfDocument.
228+
* Create an embedded file specification.
214229
*
215-
* @param doc
216-
* @param filePath
217-
* @param description
218-
* @param fileDisplay
219-
* @param mimeType
220-
* @param afRelationshipValue
221-
* @throws IOException
230+
* @param doc {@link PdfDocument} instance to make this file specification indirect
231+
* @param filePath file specification string, describing the path to the file to embed
232+
* @param description file description
233+
* @param fileDisplay actual file name stored in the pdf
234+
* @param mimeType subtype of the embedded file. The value of this entry shall conform
235+
* to the MIME media type names
236+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
237+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
238+
* {@link PdfName#Unspecified} will be added.
239+
* @return {@link PdfFileSpec} containing the file specification of the file
240+
* @throws IOException if there are errors while creating an URL from the passed file path.
222241
*/
223242
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, String filePath, String description, String fileDisplay, PdfName mimeType, PdfName afRelationshipValue) throws IOException {
224243
return createEmbeddedFileSpec(doc, filePath, description, fileDisplay, mimeType, null, afRelationshipValue);
225244
}
226245

227246
/**
228-
* Embed a file to a PdfDocument.
247+
* Create an embedded file specification.
229248
*
230-
* @param doc
231-
* @param filePath
232-
* @param description
233-
* @param fileDisplay
234-
* @param afRelationshipValue
235-
* @throws IOException
249+
* @param doc {@link PdfDocument} instance to make this file specification indirect
250+
* @param filePath file specification string, describing the path to the file to embed
251+
* @param description file description
252+
* @param fileDisplay actual file name stored in the pdf
253+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
254+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
255+
* {@link PdfName#Unspecified} will be added.
256+
* @return @return {@link PdfFileSpec} containing the file specification of the file
257+
* @throws IOException if there are errors while creating an URL from the passed file path.
236258
*/
237259
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, String filePath, String description, String fileDisplay, PdfName afRelationshipValue) throws IOException {
238260
return createEmbeddedFileSpec(doc, filePath, description, fileDisplay, null, null, afRelationshipValue);
239261
}
240262

241263
/**
242-
* Embed a file to a PdfDocument.
264+
* Create an embedded file specification.
243265
*
244-
* @param doc
245-
* @param filePath
246-
* @param fileDisplay
247-
* @param afRelationshipValue
248-
* @throws IOException
266+
* @param doc {@link PdfDocument} instance to make this file specification indirect
267+
* @param filePath path to the file to embed
268+
* @param fileDisplay actual file name stored in the pdf
269+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
270+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
271+
* {@link PdfName#Unspecified} will be added.
272+
* @return {@link PdfFileSpec} containing the file specification of the file
273+
* @throws IOException if there are errors while creating an URL from the passed file path.
249274
*/
250275
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, String filePath, String fileDisplay, PdfName afRelationshipValue) throws IOException {
251276
return createEmbeddedFileSpec(doc, filePath, null, fileDisplay, null, null, afRelationshipValue);
252277
}
253278

254279
/**
255-
* Embed a file to a PdfDocument.
280+
* Create an embedded file specification.
256281
*
257-
* @param doc
258-
* @param is
259-
* @param description
260-
* @param fileDisplay
261-
* @param mimeType
262-
* @param fileParameter
263-
* @param afRelationshipValue
282+
* @param doc {@link PdfDocument} instance to make this file specification indirect
283+
* @param is stream containing the file to embed
284+
* @param description file description
285+
* @param fileDisplay actual file name stored in the pdf
286+
* @param mimeType subtype of the embedded file. The value of this entry shall conform
287+
* to the MIME media type names
288+
* @param fileParameter dictionary with file parameters
289+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
290+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
291+
* {@link PdfName#Unspecified} will be added.
292+
* @return {@link PdfFileSpec} containing the file specification of the file
264293
*/
265294
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, InputStream is, String description, String fileDisplay, PdfName mimeType, PdfDictionary fileParameter, PdfName afRelationshipValue) {
266295
PdfStream stream = new PdfStream(doc, is);
@@ -276,28 +305,36 @@ public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, InputStream is
276305
}
277306

278307
/**
279-
* Embed a file to a PdfDocument.
308+
* Create an embedded file specification.
280309
*
281-
* @param doc
282-
* @param is
283-
* @param description
284-
* @param fileDisplay
285-
* @param mimeType
286-
* @param afRelationshipValue
310+
* @param doc {@link PdfDocument} instance to make this file specification indirect
311+
* @param is stream containing the file to embed
312+
* @param description file description
313+
* @param fileDisplay actual file name stored in the pdf
314+
* @param mimeType subtype of the embedded file. The value of this entry shall conform
315+
* to the MIME media type names
316+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
317+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
318+
* {@link PdfName#Unspecified} will be added.
319+
* @return {@link PdfFileSpec} containing the file specification of the file
287320
*/
288321
public static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, InputStream is, String description, String fileDisplay, PdfName mimeType, PdfName afRelationshipValue) {
289322
return createEmbeddedFileSpec(doc, is, description, fileDisplay, mimeType, null, afRelationshipValue);
290323
}
291324

292325
/**
293-
* Embed a file to a PdfDocument.
326+
* Create an embedded file specification.
294327
*
295-
* @param doc
296-
* @param stream
297-
* @param description
298-
* @param fileDisplay
299-
* @param mimeType
300-
* @param afRelationshipValue
328+
* @param doc {@link PdfDocument} instance to make this file specification indirect
329+
* @param stream an embedded file stream dictionary
330+
* @param description file description
331+
* @param fileDisplay actual file name stored in the pdf
332+
* @param mimeType subtype of the embedded file. The value of this entry shall conform
333+
* to the MIME media type names
334+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
335+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
336+
* {@link PdfName#Unspecified} will be added.
337+
* @return {@link PdfFileSpec} containing the file specification of the file
301338
*/
302339
private static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, PdfStream stream, String description, String fileDisplay, PdfName mimeType, PdfName afRelationshipValue) {
303340
PdfDictionary dict = new PdfDictionary();
@@ -330,12 +367,15 @@ private static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, PdfStream str
330367
}
331368

332369
/**
333-
* Embed a file to a PdfDocument.
370+
* Create an embedded file specification.
334371
*
335-
* @param doc
336-
* @param stream
337-
* @param fileDisplay
338-
* @param afRelationshipValue
372+
* @param doc {@link PdfDocument} instance to make this file specification indirect
373+
* @param stream an embedded file stream dictionary
374+
* @param fileDisplay actual file name stored in the pdf
375+
* @param afRelationshipValue value that represents the relationship between the component of the passed PDF document that
376+
* refers to this file specification and the associated file. If <CODE>null</CODE>,
377+
* {@link PdfName#Unspecified} will be added.
378+
* @return {@link PdfFileSpec} containing the file specification of the file
339379
*/
340380
private static PdfFileSpec createEmbeddedFileSpec(PdfDocument doc, PdfStream stream, String description, String fileDisplay, PdfName afRelationshipValue) {
341381
return createEmbeddedFileSpec(doc, stream, description, fileDisplay, null, afRelationshipValue);

0 commit comments

Comments
 (0)