|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.runtime.internal.adaptor.BasicLocation
public class BasicLocation
Internal class.
| Field Summary | |
|---|---|
static boolean |
DEBUG
|
static java.lang.String |
PROP_OSGI_LOCKING
|
| Fields inherited from interface org.eclipse.osgi.service.datalocation.Location |
|---|
CONFIGURATION_FILTER, ECLIPSE_HOME_FILTER, INSTALL_FILTER, INSTANCE_FILTER, USER_FILTER |
| Constructor Summary | |
|---|---|
BasicLocation(java.lang.String property,
java.net.URL defaultValue,
boolean isReadOnly,
java.lang.String dataAreaPrefix)
|
|
| Method Summary | |
|---|---|
boolean |
allowsDefault()
Returns true if this location allows a default value to be assigned
and false otherwise. |
Location |
createLocation(Location parentLocation,
java.net.URL defaultLocation,
boolean readonly)
Constructs a new location. |
static Locker |
createLocker(java.io.File lock,
java.lang.String lockMode)
|
java.net.URL |
getDataArea(java.lang.String filename)
Returns a URL to the specified path within this location. |
java.net.URL |
getDefault()
Returns the default value of this location if any. |
Location |
getParentLocation()
Returns the parent of this location or null if none is available. |
java.net.URL |
getURL()
Returns the actual URL of this location. |
boolean |
isLocked()
Returns true if this location is locked and false
otherwise. |
boolean |
isReadOnly()
Returns true if this location represents a read only location and
false otherwise. |
boolean |
isSet()
Returns true if this location has a value and false
otherwise. |
boolean |
lock()
Attempts to lock this location with a canonical locking mechanism and return true if the lock could be acquired. |
void |
release()
Releases the lock on this location. |
boolean |
set(java.net.URL value,
boolean lock)
Sets and optionally locks the location's value to the given URL. |
boolean |
set(java.net.URL value,
boolean lock,
java.lang.String lockFilePath)
Sets and optionally locks the location's value to the given URL using the given lock file. |
void |
setParent(Location value)
|
boolean |
setURL(java.net.URL value,
boolean lock)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROP_OSGI_LOCKING
public static boolean DEBUG
| Constructor Detail |
|---|
public BasicLocation(java.lang.String property,
java.net.URL defaultValue,
boolean isReadOnly,
java.lang.String dataAreaPrefix)
| Method Detail |
|---|
public static Locker createLocker(java.io.File lock,
java.lang.String lockMode)
public boolean allowsDefault()
Locationtrue if this location allows a default value to be assigned
and false otherwise.
allowsDefault in interface Locationpublic java.net.URL getDefault()
Locationnull is returned. Note that even locations which allow defaults may still
return null.
getDefault in interface Locationnullpublic Location getParentLocation()
Locationnull if none is available.
getParentLocation in interface Locationnullpublic java.net.URL getURL()
LocationURL of this location. If the location's value has been set,
that value is returned. If the value is not set and the location allows defaults,
the value is set to the default and returned. In all other cases null
is returned.
getURL in interface Locationnull if nonepublic boolean isSet()
Locationtrue if this location has a value and false
otherwise.
isSet in interface Locationpublic boolean isReadOnly()
Locationtrue if this location represents a read only location and
false otherwise. The read only character
of a location is not in enforced in any way but rather expresses the intention of the
location's creator.
isReadOnly in interface Location
public boolean setURL(java.net.URL value,
boolean lock)
throws java.lang.IllegalStateException
LocationURL. If the location
already has a value an exception is thrown. If locking is requested and fails, false
is returned and the URL of this location is not set.
setURL in interface Locationvalue - the value of this locationlock - whether or not to lock this location
java.lang.IllegalStateException - if the location's value is already set
public boolean set(java.net.URL value,
boolean lock)
throws java.lang.IllegalStateException,
java.io.IOException
LocationURL. If the location
already has a value an exception is thrown. If locking is requested and fails, false
is returned and the URL of this location is not set.
set in interface Locationvalue - the value of this locationlock - whether or not to lock this location
java.lang.IllegalStateException - if the location's value is already set
java.io.IOException - if there was an unexpected problem while acquiring the lock
public boolean set(java.net.URL value,
boolean lock,
java.lang.String lockFilePath)
throws java.lang.IllegalStateException,
java.io.IOException
LocationURL using the given lock file. If the location
already has a value an exception is thrown. If locking is requested and fails, false
is returned and the URL of this location is not set.
set in interface Locationvalue - the value of this locationlock - whether or not to lock this locationlockFilePath - the path to the lock file. This path will be used to establish locks on this location.
The path may be an absolute path or it may be relative to the given URL. If a null
value is used then a default lock path will be used for this location.
java.lang.IllegalStateException - if the location's value is already set
java.io.IOException - if there was an unexpected problem while acquiring the lockpublic void setParent(Location value)
public boolean lock()
throws java.io.IOException
Locationtrue if the lock could be acquired. Not all locations can be
locked.
Locking a location is advisory only. That is, it does not prevent other applications from modifying the same location
lock in interface Locationjava.io.IOException - if there was an unexpected problem while acquiring the lock
public boolean isLocked()
throws java.io.IOException
Locationtrue if this location is locked and false
otherwise.
isLocked in interface Locationjava.io.IOException - if there was an unexpected problem reading the lockpublic void release()
Location
release in interface Location
public Location createLocation(Location parentLocation,
java.net.URL defaultLocation,
boolean readonly)
Location
createLocation in interface LocationparentLocation - the parent location. A null value is allowed.defaultLocation - the default value of the location. A null value is allowed.readonly - true if the location is read-only.
public java.net.URL getDataArea(java.lang.String filename)
throws java.io.IOException
LocationThis method can be used to obtain a private area within the given location. For example use the symbolic name of a bundle to obtain a data area specific to that bundle.
Clients should check if the location is read only before writing anything
to the returned data area. An IOException will be thrown if
this method is called and the location URL has not been set and there is
no default value for this location.
getDataArea in interface Locationfilename - the name of the path to get from this location
java.io.IOException - if the location URL is not already set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||