本文整理匯總了Java中org.osgi.service.prefs.BackingStoreException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java BackingStoreException.getMessage方法的具體用法?Java BackingStoreException.getMessage怎麽用?Java BackingStoreException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.osgi.service.prefs.BackingStoreException
的用法示例。
在下文中一共展示了BackingStoreException.getMessage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: removeResource
import org.osgi.service.prefs.BackingStoreException; //導入方法依賴的package包/類
/**
* Remove a resource (i.e. all its properties) from the builder's preferences.
*
* @param prefs the preferences
* @param resource the resource
* @throws BackingStoreException
*/
public static void removeResource(Preferences prefs, IResource resource)
throws CoreException {
try {
String[] keys = prefs.keys();
for (String key: keys) {
if (key.endsWith("//" + resource.getProjectRelativePath().toPortableString())) {
prefs.remove(key);
}
}
prefs.flush();
} catch (BackingStoreException e) {
throw new CoreException(new Status(
IStatus.ERROR, MinifyBuilder.BUILDER_ID, e.getMessage(), e));
}
}
示例2: moveResource
import org.osgi.service.prefs.BackingStoreException; //導入方法依賴的package包/類
/**
* Associate one resource's properties with another resource.
*
* @param fromPrefs the preferences to take the properties from
* @param fromResource the resource to take the properties from
* @param toPrefs the preferences to move the properties to
* @param toResource the resource to associated with the properties
* @throws BackingStoreException
*/
public static void moveResource(Preferences fromPrefs, IResource fromResource,
Preferences toPrefs, IResource toResource)
throws CoreException {
try {
String[] keys = fromPrefs.keys();
for (String key: keys) {
if (key.endsWith("//" + fromResource.getProjectRelativePath().toPortableString())) {
String resourcePreference = key.substring(0, key.indexOf('/'));
toPrefs.put(preferenceKey(toResource, resourcePreference), fromPrefs.get(key, ""));
fromPrefs.remove(key);
}
}
fromPrefs.flush();
toPrefs.flush();
} catch (BackingStoreException e) {
throw new CoreException(new Status(
IStatus.ERROR, MinifyBuilder.BUILDER_ID, e.getMessage(), e));
}
}
示例3: save
import org.osgi.service.prefs.BackingStoreException; //導入方法依賴的package包/類
public void save() throws IOException {
try {
getStorePreferences().flush();
dirty = false;
} catch (BackingStoreException e) {
throw new IOException(e.getMessage());
}
}
示例4: save
import org.osgi.service.prefs.BackingStoreException; //導入方法依賴的package包/類
@Override
public void save() throws IOException {
try {
getStorePreferences().flush();
dirty = false;
} catch (BackingStoreException e) {
throw new IOException(e.getMessage());
}
}
示例5: removeInstance
import org.osgi.service.prefs.BackingStoreException; //導入方法依賴的package包/類
@Override
public void removeInstance(String name) throws HawkInstanceNotFound, TException {
final HModel model = getHawkByName(name);
try {
HManager.getInstance().delete(model, true);
removeStateListener(model);
} catch (BackingStoreException e) {
throw new TException(e.getMessage(), e);
}
}