public Object getAttribute(String attrName) { return getAttribute(attrName, getPath()); }
public Enumeration<String> getAttributes() { return getAttributes(getPath()); }
@Deprecated // have to override for compat public void setImportant(boolean b) { getAbstractFileSystem().markImportant(getPath(), b); }
public boolean isFolder() { if (folder == null) { if ((parent == null) || getAbstractFileSystem().info.folder(getPath())) { folder = Boolean.TRUE; return true; } else { folder = Boolean.FALSE; return false; } } else { return folder.booleanValue(); } }
/** Method that allows subclasses to return its children. * * @return names (name . ext) of subfiles */ protected final String[] list() { return getAbstractFileSystem().list.children(getPath()); }
/** * Tests if file really exists or is missing. Some operation on it may be restricted. * @return true indicates that the file is missing. * @since 1.9 */ public boolean isVirtual() { return getAbstractFileSystem().checkVirtual(getPath()); }
public long getSize() { return getAbstractFileSystem().info.size(getPath()); }
public boolean canRead() { AbstractFileSystem fs = getAbstractFileSystem(); return fs.canRead(getPath()); }
/** Tests the lock if it is valid, if not throws exception. * @param l lock to test */ private void testLock(FileLock l) throws IOException { if (lock == null) { throw new FSException(NbBundle.getMessage(AbstractFileObject.class, "EXC_InvalidLock", l, getPath(), getAbstractFileSystem().getDisplayName(), lock)); } if (lock.get() != l) { throw new FSException(NbBundle.getMessage(AbstractFileObject.class, "EXC_InvalidLock", l, getPath(), getAbstractFileSystem().getDisplayName(), lock.get())); } }
public boolean canWrite() { AbstractFileSystem fs = getAbstractFileSystem(); return fs.canWrite(getPath()); }
@Deprecated // have to override for compat public boolean isReadOnly() { AbstractFileSystem fs = getAbstractFileSystem(); return fs.isReadOnly() || fs.info.readOnly(getPath()); }
public synchronized FileLock lock() throws IOException { if (lock != null) { FileLock f = lock.get(); if (f != null) { // System.out.println ("Already locked: " + this); // NOI18N throw new FileAlreadyLockedException(); } } getAbstractFileSystem().info.lock(getPath()); FileLock l = new AfLock(); lock = new WeakReference<FileLock>(l); // Thread.dumpStack (); // System.out.println ("Locking file: " + this); // NOI18N return l; }
@Override public String getMIMEType() { String retVal = getAbstractFileSystem().info.mimeType(getPath()); if (retVal == null) { retVal = super.getMIMEType(); } return retVal; }
private boolean initLastModified(boolean force) { boolean retval = force || (getLastModified() == null); if (retval) { putLastModified(getAbstractFileSystem().info.lastModified(getPath())); } return retval; }
/** Unlocks the file. Notifies the underlaying impl. */ void unlock(FileLock fLock) { FileLock currentLock = null; synchronized(this) { if (lock != null) { currentLock = lock.get(); } if (currentLock == fLock) { putLastModified(null); // clear my lock lock = null; } } getAbstractFileSystem().info.unlock(getPath()); if (isValid()) { lastModified(); } }
void setAttribute(String attrName, Object value, boolean fire) throws IOException { Object oldValue = null; //FileSystem fs = getAbstractFileSystem (); //if (fs.isReadOnly()) XMLFileSystemTestHid.java:934 // throw new FSException(NbBundle.getMessage(AbstractFileObject.class, "EXC_FSisRO", fs.getDisplayName ()); // NOI18N if (fire) { oldValue = getAttribute(attrName); } getAbstractFileSystem().attr.writeAttribute(getPath(), attrName, value); if (fire && (oldValue != value) && hasAtLeastOneListeners()) { fileAttributeChanged0(new FileAttributeEvent(this, attrName, oldValue, value)); } }
throw new FSException(NbBundle.getMessage(AbstractFileObject.class, "EXC_FoNotFolder", name, getPath(), fs.getDisplayName())); getAbstractFileSystem().change.createFolder(getPath() + PATH_SEP + name); registerChild(name); fo = getAbstractChild(name); throw new FileStateInvalidException(NbBundle.getMessage(AbstractFileObject.class, "EXC_ApplicationCreateError", getPath(), name));
testLock(lock); fullName = getPath();