public synchronized Enumeration<String> attributes(String name) { String[] arr = new String[2]; split(name, arr); Table t = loadTable(arr[0]); return t.attrs(arr[1]); }
public synchronized void renameAttributes(String oldName, String newName) { try { String[] arr = new String[2]; split(oldName, arr); Table t = loadTable(arr[0]); Map v = (Map) t.remove(arr[1]); // System.out.println ("ARg[0] = " + arr[0] + " arr[1] = " + arr[1] + " value: " + v); // NOI18N if (v == null) { // no attrs no change return; } split(newName, arr); // Remove transient attributes: Iterator it = v.entrySet().iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); if (FileUtil.transientAttributes.contains(pair.getKey())) { it.remove(); } } t.put(arr[1], v); // System.out.println ("xyz[0] = " + arr[0] + " xyz[1] = " + arr[1] + " value: " + v); // NOI18N saveTable(arr[0], t); } catch (IOException e) { ExternalUtil.exception(e); } }
public Object readAttribute(String name, String attrName) { Table t; String[] arr = new String[2]; split(name, arr); /** At the momement substitutes lack of API */ if (attrName.equals(READONLY_ATTRIBUTES)) { return info.readOnly(arr[0]) ? Boolean.TRUE : Boolean.FALSE; } synchronized (this) { // synchronized so only one table for each folder // can exist t = loadTable(arr[0]); } // JST: // had to split the code to do getAttr out of synchronized block // because the attribute can be serialized FileObject and // so the code returns back to FileSystem (that is usually synchronized) // // this leads to deadlocks between FS & DefaultAttributes implementation // // I do not know if the table should not be somehow synchronized, // but it seems ok. return t.getAttr(arr[1], attrName); }
public synchronized void deleteAttributes(String name) { try { String[] arr = new String[2]; split(name, arr); Table t = loadTable(arr[0]); if (t.remove(arr[1]) != null) { // if there is a change saveTable(arr[0], t); } } catch (IOException e) { ExternalUtil.exception(e); } }
public synchronized Enumeration attributes(String name) { String[] arr = new String[2]; split (name, arr); Table t = loadTable (arr[0]); return t.attrs (arr[1]); }
public synchronized Enumeration attributes(String name) { String[] arr = new String[2]; split (name, arr); Table t = loadTable (arr[0]); return t.attrs (arr[1]); }
public synchronized void renameAttributes (String oldName, String newName) { try { String[] arr = new String[2]; split (oldName, arr); Table t = loadTable (arr[0]); Map v = (Map) t.remove (arr[1]); // System.out.println ("ARg[0] = " + arr[0] + " arr[1] = " + arr[1] + " value: " + v); // NOI18N if (v == null) { // no attrs no change return; } split (newName, arr); // Remove transient attributes: Iterator it = v.entrySet ().iterator (); while (it.hasNext ()) { Map.Entry pair = (Map.Entry) it.next (); if (FileUtil.transientAttributes.contains (pair.getKey ())) it.remove (); } t.put (arr[1], v); // System.out.println ("xyz[0] = " + arr[0] + " xyz[1] = " + arr[1] + " value: " + v); // NOI18N saveTable (arr[0], t); } catch (IOException e) { ExternalUtil.exception (e); } }
public synchronized void renameAttributes (String oldName, String newName) { try { String[] arr = new String[2]; split (oldName, arr); Table t = loadTable (arr[0]); Map v = (Map) t.remove (arr[1]); // System.out.println ("ARg[0] = " + arr[0] + " arr[1] = " + arr[1] + " value: " + v); // NOI18N if (v == null) { // no attrs no change return; } split (newName, arr); // Remove transient attributes: Iterator it = v.entrySet ().iterator (); while (it.hasNext ()) { Map.Entry pair = (Map.Entry) it.next (); if (FileUtil.transientAttributes.contains (pair.getKey ())) it.remove (); } t.put (arr[1], v); // System.out.println ("xyz[0] = " + arr[0] + " xyz[1] = " + arr[1] + " value: " + v); // NOI18N saveTable (arr[0], t); } catch (IOException e) { ExternalUtil.exception (e); } }
public Object readAttribute(String name, String attrName) { Table t; String[] arr = new String[2]; split (name, arr); /** At the momement substitutes lack of API */ if (attrName.equals (READONLY_ATTRIBUTES)) return info.readOnly(arr[0]) ? Boolean.TRUE : Boolean.FALSE; synchronized (this) { // synchronized so only one table for each folder // can exist t = loadTable (arr[0]); } // JST: // had to split the code to do getAttr out of synchronized block // because the attribute can be serialized FileObject and // so the code returns back to FileSystem (that is usually synchronized) // // this leads to deadlocks between FS & DefaultAttributes implementation // // I do not know if the table should not be somehow synchronized, // but it seems ok. return t.getAttr (arr[1], attrName); }
public Object readAttribute(String name, String attrName) { Table t; String[] arr = new String[2]; split (name, arr); /** At the momement substitutes lack of API */ if (attrName.equals (READONLY_ATTRIBUTES)) return info.readOnly(arr[0]) ? Boolean.TRUE : Boolean.FALSE; synchronized (this) { // synchronized so only one table for each folder // can exist t = loadTable (arr[0]); } // JST: // had to split the code to do getAttr out of synchronized block // because the attribute can be serialized FileObject and // so the code returns back to FileSystem (that is usually synchronized) // // this leads to deadlocks between FS & DefaultAttributes implementation // // I do not know if the table should not be somehow synchronized, // but it seems ok. return t.getAttr (arr[1], attrName); }
public synchronized void deleteAttributes (String name) { try { String[] arr = new String[2]; split (name, arr); Table t = loadTable (arr[0]); if (t.remove (arr[1]) != null) { // if there is a change saveTable (arr[0], t); } } catch (IOException e) { ExternalUtil.exception (e); } }
public synchronized void deleteAttributes (String name) { try { String[] arr = new String[2]; split (name, arr); Table t = loadTable (arr[0]); if (t.remove (arr[1]) != null) { // if there is a change saveTable (arr[0], t); } } catch (IOException e) { ExternalUtil.exception (e); } }