本文整理汇总了Java中com.google.appengine.api.blobstore.BlobKey.equals方法的典型用法代码示例。如果您正苦于以下问题:Java BlobKey.equals方法的具体用法?Java BlobKey.equals怎么用?Java BlobKey.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.appengine.api.blobstore.BlobKey
的用法示例。
在下文中一共展示了BlobKey.equals方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteImage
import com.google.appengine.api.blobstore.BlobKey; //导入方法依赖的package包/类
/**
* Deletes the uploaded image.
*/
protected void deleteImage(BlobKey blobKey) {
if (blobKey.equals(new BlobKey(""))) {
return;
}
try {
deleteUploadedFile(blobKey);
} catch (BlobstoreFailureException bfe) {
statusToAdmin = Const.ACTION_RESULT_FAILURE
+ " : Unable to delete picture (possible unused picture with key: "
+ blobKey.getKeyString()
+ " || Error Message: "
+ bfe.getMessage() + Const.EOL;
}
}
示例2: deletePicture
import com.google.appengine.api.blobstore.BlobKey; //导入方法依赖的package包/类
private void deletePicture(BlobKey blobKey) {
if (blobKey.equals(new BlobKey(""))) {
return;
}
try {
logic.deletePicture(blobKey);
} catch (BlobstoreFailureException bfe) {
statusToAdmin = Const.ACTION_RESULT_FAILURE
+ " : Unable to delete profile picture (possible unused picture with key: "
+ blobKey.getKeyString() + " || Error Message: "
+ bfe.getMessage() + Const.EOL;
}
}
示例3: deleteGroupReceiverListFile
import com.google.appengine.api.blobstore.BlobKey; //导入方法依赖的package包/类
private void deleteGroupReceiverListFile(BlobKey blobKey) {
if (blobKey.equals(new BlobKey(""))) {
return;
}
try {
logic.deleteAdminEmailUploadedFile(blobKey);
} catch (BlobstoreFailureException bfe) {
statusToAdmin = Const.ACTION_RESULT_FAILURE
+ " : Unable to delete group receiver list file (possible unused file with key: "
+ blobKey.getKeyString()
+ " || Error Message: "
+ bfe.getMessage() + Const.EOL;
}
}
示例4: updateStationImageAttributes
import com.google.appengine.api.blobstore.BlobKey; //导入方法依赖的package包/类
/**
* Update StationImage attributes.
* Update's the given StationImage's attributes in the datastore.
* @param key
* : the key of the StationImage whose attributes will be updated
* @param stationImageName
* : stationImage name
* @param stationImageMultimediaContent
* : stationImage multimedia content
* @param stationImageFormat
* : stationImage format
* @throws MissingRequiredFieldsException
* @throws ObjectExistsInDatastoreException
*/
public static void updateStationImageAttributes(
Key key,
String stationImageName,
BlobKey stationImageMultimediaContent,
String stationImageFormat)
throws MissingRequiredFieldsException,
ObjectExistsInDatastoreException {
PersistenceManager pm = PMF.get().getPersistenceManager();
Station station = pm.getObjectById(Station.class, key.getParent());
Transaction tx = pm.currentTransaction();
try {
StationImage stationImage = pm.getObjectById(StationImage.class, key);
// Check if station image already exists in datastore
if (stationImageExists(key.getParent(), stationImageName) &&
!stationImage.getStationImageName().equals(stationImageName)) {
throw new ObjectExistsInDatastoreException(stationImage, "A station image " +
"with this title has already been added.");
}
BlobKey oldStationImageMultimediaContent =
stationImage.getStationImageMultimediaContent();
tx.begin();
stationImage.setStationImageName(stationImageName);
stationImage.setStationImageMultimediaContent(stationImageMultimediaContent);
stationImage.setStationImageFormat(stationImageFormat);
station.updateStationImageVersion();
if (!oldStationImageMultimediaContent.equals(stationImageMultimediaContent) &&
oldStationImageMultimediaContent != null) {
blobstoreService.delete(oldStationImageMultimediaContent);
}
tx.commit();
log.info("StationImage \"" + stationImage.getStationImageName() +
"\"'s attributes updated in datastore.");
}
finally {
if (tx.isActive()) {
tx.rollback();
}
pm.close();
}
}
示例5: updateStationAudioAttributes
import com.google.appengine.api.blobstore.BlobKey; //导入方法依赖的package包/类
/**
* Update StationAudio attributes.
* Update's the given StationAudio's attributes in the datastore.
* @param key
* : the key of the StationAudio whose attributes will be updated
* @param stationAudioName
* : stationAudio name
* @param stationAudioMultimediaContent
* : stationAudio multimedia content
* @param stationAudioDuration
* : stationAudio duration
* @param stationAudioFormat
* : stationAudio format
* @throws MissingRequiredFieldsException
* @throws ObjectExistsInDatastoreException
*/
public static void updateStationAudioAttributes(
Key key,
StationAudio.StationAudioType stationAudioType,
String stationAudioName,
BlobKey stationAudioMultimediaContent,
Double stationAudioDuration,
String stationAudioFormat)
throws MissingRequiredFieldsException,
ObjectExistsInDatastoreException {
PersistenceManager pm = PMF.get().getPersistenceManager();
Station station = pm.getObjectById(Station.class, key.getParent());
Transaction tx = pm.currentTransaction();
try {
StationAudio stationAudio = pm.getObjectById(StationAudio.class, key);
// Check if station audio already exists in datastore
if (stationAudioExists(key.getParent(), stationAudioName) &&
!stationAudio.getStationAudioName().equals(stationAudioName)) {
throw new ObjectExistsInDatastoreException(stationAudio, "A station audio " +
"with this title has already been added.");
}
BlobKey oldStationAudioMultimediaContent =
stationAudio.getStationAudioMultimediaContent();
tx.begin();
stationAudio.setStationAudioType(stationAudioType);
stationAudio.setStationAudioName(stationAudioName);
stationAudio.setStationAudioMultimediaContent(stationAudioMultimediaContent);
stationAudio.setStationAudioDuration(stationAudioDuration);
stationAudio.setStationAudioFormat(stationAudioFormat);
station.updateStationAudioVersion();
tx.commit();
if (!oldStationAudioMultimediaContent.equals(stationAudioMultimediaContent) &&
oldStationAudioMultimediaContent != null) {
blobstoreService.delete(oldStationAudioMultimediaContent);
}
log.info("StationAudio \"" + stationAudio.getStationAudioName() +
"\"'s attributes updated in datastore.");
}
finally {
if (tx.isActive()) {
tx.rollback();
}
pm.close();
}
}
示例6: updateStationAttributes
import com.google.appengine.api.blobstore.BlobKey; //导入方法依赖的package包/类
/**
* Update Station attributes.
* Update's the given Station's attributes in the datastore.
* @param email
* : the email of the Station whose attributes will be updated
* @param stationType
* : the new station type's key to give to the Station
* @param stationPrivilegeLevel
* : the new privilege level of the station
* @param stationName
* : the new name to give to the Station
* @param stationNumber
* : the new number to give to the Station
* @param stationDescription
* : the new description to give to the Station
* @param region
* : the new region of the Station
* @param stationAddress
* : the new address of the Station
* @param stationWebsite
* : Station website
* @param stationLogo
* : Station logo blob key
* @param stationComments
* : the new comments to give to the Station
* @throws MissingRequiredFieldsException
*/
public static void updateStationAttributes(
Email email,
Long stationType,
Integer stationPrivilegeLevel,
String stationName,
String stationNumber,
String stationDescription,
Long region,
PostalAddress stationAddress,
Link stationWebsite,
BlobKey stationLogo,
String stationComments)
throws MissingRequiredFieldsException {
PersistenceManager pm = PMF.get().getPersistenceManager();
Transaction tx = pm.currentTransaction();
try {
Key key = KeyFactory.createKey(Station.class.getSimpleName(),
email.getEmail());
Station station = pm.getObjectById(Station.class, key);
BlobKey oldStationLogo = station.getStationLogo();
tx.begin();
station.setStationType(stationType);
station.setPrivilegeLevel(stationPrivilegeLevel);
station.setStationName(stationName);
station.setStationNumber(stationNumber);
station.setStationDescription(stationDescription);
station.setRegion(region);
station.setStationAddress(stationAddress);
station.setStationWebsite(stationWebsite);
station.setStationLogo(stationLogo);
station.setStationComments(stationComments);
tx.commit();
if (!oldStationLogo.equals(stationLogo) &&
oldStationLogo != null) {
blobstoreService.delete(oldStationLogo);
}
log.info("Station \"" + email.getEmail() +
"\"'s attributes updated in datastore.");
}
finally {
if (tx.isActive()) {
tx.rollback();
}
pm.close();
}
}