This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 18368
Collapse All | Expand All

(-)DefaultAttributes.java (-2 / +62 lines)
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
    }
(-)ExLocalFileSystem.java (-2 / +17 lines)
Line 27 Link Here
27
import org.openide.util.Utilities;
Line 107 Link Here
107
108
        
108
--
Line 110 Link Here
111
            // In NB 3.2.x for OpenVMS, we had to use the "_" as a backup extension.
112
            // However, OpenVMS now supports various special characters including "~".
113
            // So we now have to change the existing backup files ending with "_" into "~".
114
            //
115
            if ( Utilities.getOperatingSystem () == Utilities.OS_VMS ) {
116
                if ( arr[i].endsWith (".java_") ) {
117
                    try {
118
                        String newBackupFile = arr[i].substring (0, arr[i].length()-1) + BACKUP_EXT;           
119
                        super.rename (name + "/" + arr[i], name + "/" + newBackupFile);
120
                        arr[i] = new String (newBackupFile);
121
                    } catch (IOException fex) {                        
122
                    } 
123
                }
124
            }
125
  

Return to bug 18368