/** * Refreshes the properties of this Partition object instance with values from the AFS partition * it represents. If <CODE>all</CODE> is <CODE>true</CODE> then <U>all</U> of the properties of * this Partition object instance will be set, or renewed, according to the values of the AFS * partition it represents, disregarding any previously set properties. * * <p>Thus, if <CODE>all</CODE> is <CODE>false</CODE> then properties that are currently set will * be refreshed and properties that are not set will remain uninitialized. See {@link #refresh()} * for more information. * * @param all if true set or renew all object properties; otherwise renew all set properties * @exception AFSException If an error occurs in the native code * @see #refresh() */ protected void refresh(boolean all) throws AFSException { if (all || volumes != null) { refreshVolumes(); } if (all || volumeNames != null) { refreshVolumeNames(); } if (all || cachedInfo) { refreshInfo(); } }
/** * Returns the total used space on this partition. After this method is called once, it saves the * total used space and returns that value on subsequent calls, until the {@link #refresh()} * method is called and a more current value is obtained. * * @exception AFSException If an error occurs in the native code * @return the total used space on this partition * @see #refresh() */ public int getUsedSpace() throws AFSException { if (!cachedInfo) refreshInfo(); return (totalSpace - totalFreeSpace); }
/** * Returns the total free space on this partition. After this method is called once, it saves the * total free space and returns that value on subsequent calls, until the {@link #refresh()} * method is called and a more current value is obtained. * * @exception AFSException If an error occurs in the native code * @return the total free space on this partition * @see #refresh() */ public int getTotalFreeSpace() throws AFSException { if (!cachedInfo) refreshInfo(); return totalFreeSpace; }
/** * Returns the lock file descriptor of this partition * * @exception AFSException If an error occurs in the native code * @return the lock file descriptor of this partition * @see #refresh() */ public int getLockFileDescriptor() throws AFSException { if (!cachedInfo) refreshInfo(); return lockFileDescriptor; }
/** * Returns the device name of this partition (i.e. "hda5", etc.) * * @exception AFSException If an error occurs in the native code * @return the device name of this partition * @see #refresh() */ public String getDeviceName() throws AFSException { if (!cachedInfo) refreshInfo(); return deviceName; }