]> _ Git - cubeextranet.git/blob
80a129ba600222df50a1a12e48a917d173675405
[cubeextranet.git] /
1 /*\r
2  * Licensed to the Apache Software Foundation (ASF) under one or more\r
3  * contributor license agreements.  See the NOTICE file distributed with\r
4  * this work for additional information regarding copyright ownership.\r
5  * The ASF licenses this file to You under the Apache License, Version 2.0\r
6  * (the "License"); you may not use this file except in compliance with\r
7  * the License.  You may obtain a copy of the License at\r
8  *\r
9  *      http://www.apache.org/licenses/LICENSE-2.0\r
10  *\r
11  * Unless required by applicable law or agreed to in writing, software\r
12  * distributed under the License is distributed on an "AS IS" BASIS,\r
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14  * See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  */\r
17 package org.apache.pdfbox.pdmodel.common.filespecification;\r
18 \r
19 import org.apache.pdfbox.cos.COSBase;\r
20 import org.apache.pdfbox.cos.COSString;\r
21 \r
22 /**\r
23  * A file specification that is just a string.\r
24  *\r
25  * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>\r
26  * @version $Revision: 1.2 $\r
27  */\r
28 public class PDSimpleFileSpecification extends PDFileSpecification\r
29 {\r
30     private COSString file;\r
31 \r
32     /**\r
33      * Constructor.\r
34      *\r
35      */\r
36     public PDSimpleFileSpecification()\r
37     {\r
38         file = new COSString( "" );\r
39     }\r
40 \r
41     /**\r
42      * Constructor.\r
43      *\r
44      * @param fileName The file that this spec represents.\r
45      */\r
46     public PDSimpleFileSpecification( COSString fileName )\r
47     {\r
48         file = fileName;\r
49     }\r
50 \r
51     /**\r
52      * This will get the file name.\r
53      *\r
54      * @return The file name.\r
55      */\r
56     public String getFile()\r
57     {\r
58     return file.getString();\r
59     }\r
60 \r
61     /**\r
62      * This will set the file name.\r
63      *\r
64      * @param fileName The name of the file.\r
65      */\r
66     public void setFile( String fileName )\r
67     {\r
68     file = new COSString( fileName );\r
69     }\r
70 \r
71     /**\r
72      * Convert this standard java object to a COS object.\r
73      *\r
74      * @return The cos object that matches this Java object.\r
75      */\r
76     public COSBase getCOSObject()\r
77     {\r
78         return file;\r
79     }\r
80 \r
81 }\r