FileSystem writableLayer(String path) { if (!insideWritableLayer.get() && /* #183936 */!isReadOnly()) { // #181460: avoid stack overflow when createWritableOn calls e.g. findResource insideWritableLayer.set(true); try { return createWritableOn(path); } catch (IOException x) { // ignore } finally { insideWritableLayer.set(false); } } return systems.length > WRITE_SYSTEM_INDEX ? systems[WRITE_SYSTEM_INDEX] : null; }
/** Finds the system to create writable version of the file on. * * @param name name of the file (full) * @return the first one * @exception IOException if the filesystem is readonly */ protected FileSystem createWritableOn(String name) throws IOException { if (isReadOnly()) { throw new FSException(NbBundle.getMessage(MultiFileSystem.class, "EXC_FSisRO", getDisplayName())); } return systems[WRITE_SYSTEM_INDEX]; }
@Deprecated // have to override for compat public boolean isReadOnly() { MultiFileSystem fs = getMultiFileSystem(); if (fs.isReadOnly()) { return true; } if (leader.isReadOnly()) { // if we can make it writable then nothing try { FileSystem simple = fs.createWritableOn(getPath()); return simple == leader.getFileSystem(); } catch (IOException e) { return true; } } return false; }
public boolean canWrite() { MultiFileSystem fs = getMultiFileSystem(); if (fs.isReadOnly()) { return false; } if (!leader.canWrite()) { // if we can make it writable then nothing try { FileSystem simple = fs.createWritableOn(getPath()); return simple != leader.getFileSystem(); } catch (IOException e) { return false; } } return true; }
MultiFileSystem fs = getMultiFileSystem(); if (fs.isReadOnly()) { throw new FSException(NbBundle.getMessage(MultiFileObject.class, "EXC_FSisRO", fs.getDisplayName()));
MultiFileSystem fs = getMultiFileSystem(); if (fs.isReadOnly()) { throw new FSException(NbBundle.getMessage(MultiFileObject.class, "EXC_FSisRO", fs.getDisplayName()));
if (fs.isReadOnly()) { throw new FSException(NbBundle.getMessage(MultiFileObject.class, "EXC_FSisRO", fs.getDisplayName()));
public boolean isReadOnly () { MultiFileSystem fs = getMultiFileSystem (); if (fs.isReadOnly ()) { return true; } if (leader.isReadOnly ()) { // if we can make it writable then nothing try { FileSystem simple = fs.createWritableOn (getPath ()); return simple == leader.getFileSystem (); } catch (IOException e) { return true; } } return false; }
public boolean isReadOnly () { MultiFileSystem fs = getMultiFileSystem (); if (fs.isReadOnly ()) { return true; } if (leader.isReadOnly ()) { // if we can make it writable then nothing try { FileSystem simple = fs.createWritableOn (getPath ()); return simple == leader.getFileSystem (); } catch (IOException e) { return true; } } return false; }
if (fs.isReadOnly()) { FSException.io ("EXC_FSisRO", fs.getDisplayName ()); // NOI18N
if (fs.isReadOnly()) { FSException.io ("EXC_FSisRO", fs.getDisplayName ()); // NOI18N
synchronized (this) { MultiFileSystem fs = getMultiFileSystem (); if (fs.isReadOnly()) { FSException.io ("EXC_FSisRO", fs.getDisplayName ()); // NOI18N
synchronized (this) { MultiFileSystem fs = getMultiFileSystem (); if (fs.isReadOnly()) { FSException.io ("EXC_FSisRO", fs.getDisplayName ()); // NOI18N
synchronized (this) { MultiFileSystem fs = getMultiFileSystem (); if (fs.isReadOnly()) { FSException.io ("EXC_FSisRO", fs.getDisplayName ()); // NOI18N
synchronized (this) { MultiFileSystem fs = getMultiFileSystem (); if (fs.isReadOnly()) { FSException.io ("EXC_FSisRO", fs.getDisplayName ()); // NOI18N