Line 23
Link Here
|
|
|
23 |
import org.openide.util.Utilities; |
Line 155
Link Here
|
155 |
if (size == 1) { |
156 |
if (size == 1) { |
156 |
-- |
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 |
|
Line 165
Link Here
|
|
|
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 |
|
Line 175
Link Here
|
|
|
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 |
} |