本文整理汇总了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);
}
}