Lines 20-25
Link Here
|
20 |
import org.openide.util.NbBundle; |
20 |
import org.openide.util.NbBundle; |
21 |
import org.openide.util.enum.EmptyEnumeration; |
21 |
import org.openide.util.enum.EmptyEnumeration; |
22 |
import org.openide.util.io.NbMarshalledObject; |
22 |
import org.openide.util.io.NbMarshalledObject; |
|
|
23 |
import org.openide.util.Utilities; |
23 |
|
24 |
|
24 |
import org.xml.sax.*; |
25 |
import org.xml.sax.*; |
25 |
import org.xml.sax.helpers.ParserFactory; |
26 |
import org.xml.sax.helpers.ParserFactory; |
Lines 152-158
Link Here
|
152 |
|
153 |
|
153 |
int size = arr.length; |
154 |
int size = arr.length; |
154 |
|
155 |
|
155 |
if (size == 1) { |
156 |
if (size == 1) { |
|
|
157 |
// In NB 3.2.x for OpenVMS, we had to use "_nbattrs." as a attribute file. |
158 |
// However, OpenVMS now supports a file name beginning with "." |
159 |
// So we now have to change the existing "_nbattrs." file into ".nbattrs" |
160 |
// |
161 |
if (Utilities.getOperatingSystem () == Utilities.OS_VMS && arr[0] != null && f != null) { |
162 |
if (arr[0].equalsIgnoreCase ("_nbattrs.")) { |
163 |
try { |
164 |
renameVMSAttrFile (f); |
165 |
} catch (IOException ioe) {} |
166 |
arr[0] = new String (ATTR_NAME_EXT_XML); |
167 |
} |
168 |
} |
169 |
|
156 |
if ((ATTR_NAME_EXT_XML.equals(arr[0]) || ATTR_NAME_EXT.equals(arr[0]))) { |
170 |
if ((ATTR_NAME_EXT_XML.equals(arr[0]) || ATTR_NAME_EXT.equals(arr[0]))) { |
157 |
try { |
171 |
try { |
158 |
change.delete(f+"/"+arr[0]); // NOI18N |
172 |
change.delete(f+"/"+arr[0]); // NOI18N |
Lines 162-167
Link Here
|
162 |
} |
176 |
} |
163 |
|
177 |
|
164 |
for (int i = 0; i < size; i++) { |
178 |
for (int i = 0; i < size; i++) { |
|
|
179 |
// In NB 3.2.x for OpenVMS, we had to use "_nbattrs." as a attribute file. |
180 |
// However, OpenVMS now supports a file name beginning with "." |
181 |
// So we now have to change the existing "_nbattrs." file into ".nbattrs" |
182 |
// |
183 |
if (Utilities.getOperatingSystem () == Utilities.OS_VMS && arr[i] != null && f != null) { |
184 |
if (arr[i].equalsIgnoreCase ("_nbattrs.")) { |
185 |
try { |
186 |
renameVMSAttrFile (f); |
187 |
} catch (IOException ioe) {} |
188 |
arr[i] = new String (ATTR_NAME_EXT_XML); |
189 |
} |
190 |
} |
191 |
|
165 |
if (ATTR_NAME_EXT.equals (arr[i]) || ATTR_NAME_EXT_XML.equals (arr[i])) { |
192 |
if (ATTR_NAME_EXT.equals (arr[i]) || ATTR_NAME_EXT_XML.equals (arr[i])) { |
166 |
// exclude this index |
193 |
// exclude this index |
167 |
arr[i] = null; |
194 |
arr[i] = null; |
Lines 172-177
Link Here
|
172 |
return arr; |
199 |
return arr; |
173 |
} |
200 |
} |
174 |
|
201 |
|
|
|
202 |
/** Renames the attribute file for OpenVMS platform. |
203 |
* The method renames "_nbattrs." into ".nbattrs". |
204 |
* We cannot simply use the change.rename method |
205 |
* because of the special property of OpenVMS having to do with |
206 |
* a file name starting with "." |
207 |
* |
208 |
* @param f the folder containg the attribute file |
209 |
*/ |
210 |
private void renameVMSAttrFile (String f) throws IOException { |
211 |
InputStream is = null; |
212 |
OutputStream os = null; |
213 |
|
214 |
try { |
215 |
change.createData (f+"/"+ATTR_NAME_EXT_XML); |
216 |
is = info.inputStream (f+"/"+"_nbattrs."); |
217 |
os = info.outputStream (f+"/"+ATTR_NAME_EXT_XML); |
218 |
|
219 |
byte [] buf = new byte[256]; |
220 |
int readi; |
221 |
while ( (readi=is.read(buf,0,256)) >= 0x0 ) { |
222 |
os.write (buf,0,readi); |
223 |
} |
224 |
|
225 |
is.close (); |
226 |
change.delete (f+"/"+"_nbattrs."); |
227 |
is = null; |
228 |
} catch (IOException ie) { |
229 |
} finally { |
230 |
if (is != null) |
231 |
is.close (); |
232 |
if (os != null) |
233 |
os.close (); |
234 |
} |
235 |
} |
175 |
|
236 |
|
176 |
// JST: Description |
237 |
// JST: Description |
177 |
// |
238 |
// |