本文整理汇总了Java中com.dd.plist.PropertyListFormatException类的典型用法代码示例。如果您正苦于以下问题:Java PropertyListFormatException类的具体用法?Java PropertyListFormatException怎么用?Java PropertyListFormatException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyListFormatException类属于com.dd.plist包,在下文中一共展示了PropertyListFormatException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onRunJob
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
@NonNull
@Override
protected Result onRunJob(Params params) {
PersistableBundleCompat extras = params.getExtras();
long paperId = extras.getLong(ARG_PAPER_ID, -1L);
Paper paper = Paper.getPaperWithId(getContext(), paperId);
if (paper != null) {
try {
Timber.i("%s", paper);
StorageManager storageManager = StorageManager.getInstance(getContext());
currentPaperId = paperId;
currentUnzipPaper = new UnzipPaper(paper,
storageManager.getDownloadFile(paper),
storageManager.getPaperDirectory(paper),
true);
currentUnzipPaper.getUnzipFile()
.addProgressListener(this);
currentUnzipPaper.start();
savePaper(paper, null);
} catch (ParserConfigurationException | IOException | SAXException | ParseException | PropertyListFormatException | UnzipCanceledException e) {
savePaper(paper, e);
}
}
return Result.SUCCESS;
}
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:27,代码来源:DownloadFinishedPaperJob.java
示例2: onRunJob
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
@NonNull
@Override
protected Result onRunJob(Params params) {
PersistableBundleCompat extras = params.getExtras();
String resourceKey = extras.getString(ARG_RESOURCE_KEY, null);
if (!TextUtils.isEmpty(resourceKey)) {
Resource resource = Resource.getWithKey(getContext(), resourceKey);
Timber.i("%s", resource);
if (resource != null && resource.isDownloading()) {
StorageManager storageManager = StorageManager.getInstance(getContext());
try {
UnzipResource unzipResource = new UnzipResource(storageManager.getDownloadFile(resource),
storageManager.getResourceDirectory(resource.getKey()),
true);
unzipResource.start();
saveResource(resource, null);
} catch (UnzipCanceledException | IOException | PropertyListFormatException | ParseException | SAXException | ParserConfigurationException e) {
saveResource(resource, e);
}
}
}
return Result.SUCCESS;
}
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:27,代码来源:DownloadFinishedResourceJob.java
示例3: Plist
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
public Plist(InputStream is, boolean parseIndex) throws IOException, PropertyListFormatException, ParseException,
ParserConfigurationException, SAXException {
root = (NSDictionary) PropertyListParser.parse(is);
is.close();
archiveUrl = PlistHelper.getString(root, KEY_ARCHIVEURL);
bookId = PlistHelper.getString(root, KEY_BOOKID);
resource = PlistHelper.getString(root, KEY_RESOURCE);
if (!TextUtils.isEmpty(resource)) {
resource = resource.replace(".res", "");
}
minVersion = PlistHelper.getString(root, KEY_MINVERSION);
version = PlistHelper.getString(root, KEY_VERSION);
parseHashVals();
if (parseIndex) {
parseSources();
parseToplinks();
}
}
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:25,代码来源:Paper.java
示例4: onHandleIntent
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
@Override
protected void onHandleIntent(Intent intent) {
String resourceKey = intent.getStringExtra(PARAM_RESOURCE_KEY);
Timber.i("Start service after downloaded for resource: %s", resourceKey);
if (!TextUtils.isEmpty(resourceKey)) {
Resource resource = Resource.getWithKey(this,resourceKey);
Timber.i("%s",resource);
if (resource.isDownloading()) {
StorageManager storageManager = StorageManager.getInstance(this);
try {
UnzipResource unzipResource = new UnzipResource(storageManager.getDownloadFile(resource),storageManager.getResourceDirectory(resource.getKey()),true);
unzipResource.start();
saveResource(resource, null);
} catch (UnzipCanceledException|IOException | PropertyListFormatException | ParseException | SAXException | ParserConfigurationException e) {
saveResource(resource,e);
}
}
}
Timber.i("Finished service after download for resource: %s", resourceKey);
}
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:23,代码来源:DownloadFinishedResourceService.java
示例5: from
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
public static Optional<InflatableData> from(byte[] bs) {
InflatableData data;
try {
NSDictionary parse = (NSDictionary) PropertyListParser.parse(bs);
byte[] escrowedKeys = ((NSData) parse.get("escrowedKeys")).bytes();
UUID deviceUuid = UUID.fromString(((NSString) parse.get("deviceUuid")).getContent());
String deviceHardWareId = ((NSString) parse.get("deviceHardWareId")).getContent();
data = new InflatableData(escrowedKeys, deviceUuid, deviceHardWareId);
} catch (ClassCastException | IllegalArgumentException | IOException | NullPointerException
| PropertyListFormatException | ParseException | ParserConfigurationException | SAXException ex) {
logger.warn("-- from() - exception: ", ex);
data = null;
}
return Optional.ofNullable(data);
}
开发者ID:horrorho,项目名称:InflatableDonkey,代码行数:17,代码来源:InflatableData.java
示例6: handleEntity
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
@Override
public T handleEntity(HttpEntity entity) throws IOException {
NSObject nsObject;
try {
// Avoiding PropertyListParser#parse(InputStream) as the current Maven build (1.16) can bug out.
nsObject = PropertyListParser.parse(EntityUtils.toByteArray(entity));
} catch (PropertyListFormatException | ParseException | ParserConfigurationException | SAXException ex) {
throw new BadDataException("failed to parse property list", ex);
}
if (to.isAssignableFrom(nsObject.getClass())) {
return to.cast(nsObject);
}
throw new BadDataException("failed to cast property list: " + nsObject.getClass());
}
开发者ID:horrorho,项目名称:InflatableDonkey,代码行数:19,代码来源:PropertyListResponseHandler.java
示例7: read
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
private NSDictionary read(final Local file) {
try {
return (NSDictionary) XMLPropertyListParser.parse(file.getInputStream());
}
catch(ParserConfigurationException
| IOException
| SAXException
| PropertyListFormatException
| ParseException
| AccessDeniedException e) {
log.warn(String.format("Failure %s reading dictionary from %s", e.getMessage(), file));
}
return null;
}
开发者ID:iterate-ch,项目名称:cyberduck,代码行数:15,代码来源:DictionaryLicense.java
示例8: parse
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
private NSObject parse(final Local file) throws AccessDeniedException {
try {
return XMLPropertyListParser.parse(file.getInputStream());
}
catch(ParserConfigurationException | IOException | SAXException | ParseException | PropertyListFormatException e) {
log.error(String.format("Invalid bookmark file %s", file));
return null;
}
}
开发者ID:iterate-ch,项目名称:cyberduck,代码行数:10,代码来源:PlistReader.java
示例9: callIdeviceInfo
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
private NSDictionary callIdeviceInfo() throws IosDeviceException {
String infoText = await(idevice.info("-x"));
byte[] infoBytes = infoText.getBytes(StandardCharsets.UTF_8);
try {
return (NSDictionary) XMLPropertyListParser.parse(infoBytes);
} catch (ParserConfigurationException
| ParseException
| PropertyListFormatException
| IOException
| SAXException e) {
throw new IosDeviceException(RealDeviceImpl.this, e);
}
}
开发者ID:google,项目名称:ios-device-control,代码行数:14,代码来源:RealDeviceImpl.java
示例10: fromPath
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
/**
* Parses the content of a plist file as UTF-8 encoded XML.
*
* @throws PlistParseException - if there is an error parsing the content.
*/
public static NSObject fromPath(Path plist) {
try {
return PropertyListParser.parse(Files.readAllBytes(plist));
} catch (ParserConfigurationException
| ParseException
| PropertyListFormatException
| IOException
| SAXException e) {
throw new PlistParseException(e);
}
}
开发者ID:google,项目名称:ios-device-control,代码行数:17,代码来源:PlistParser.java
示例11: fromXml
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
/**
* Parses an XML string to a plist object.
*
* @throws PlistParseException - if there is an error parsing the string.
*/
public static NSObject fromXml(String xml) {
try {
return XMLPropertyListParser.parse(xml.getBytes(UTF_8));
} catch (ParserConfigurationException
| ParseException
| PropertyListFormatException
| IOException
| SAXException e) {
throw new PlistParseException(e);
}
}
开发者ID:google,项目名称:ios-device-control,代码行数:17,代码来源:PlistParser.java
示例12: fromBinary
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
/**
* Parses a byte array to a plist object.
*
* @throws PlistParseException - if there is an error parsing the bytes.
*/
public static NSObject fromBinary(byte[] bytes) {
try {
return BinaryPropertyListParser.parse(bytes);
} catch (UnsupportedEncodingException | PropertyListFormatException e) {
throw new PlistParseException(e);
}
}
开发者ID:google,项目名称:ios-device-control,代码行数:13,代码来源:PlistParser.java
示例13: onHandleIntent
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
@Override
protected void onHandleIntent(Intent intent) {
if (intent.getBooleanExtra(PARAM_CANCEL_BOOL, false)) return;
long paperId = intent.getLongExtra(PARAM_PAPER_ID, -1);
Timber.i("Start service after download for paper: %d", paperId);
Paper paper = Paper.getPaperWithId(this, paperId);
if (paper != null) {
if (canceledPapersIds.contains(paperId)) {
canceledPapersIds.remove(paperId);
paper.delete(this);
return;
}
try {
Timber.i("%s", paper);
StorageManager storageManager = StorageManager.getInstance(this);
currentPaperId = paperId;
currentUnzipPaper = new UnzipPaper(paper,
storageManager.getDownloadFile(paper),
storageManager.getPaperDirectory(paper),
true);
currentUnzipPaper.getUnzipFile()
.addProgressListener(this);
currentUnzipPaper.start();
savePaper(paper, null);
} catch (ParserConfigurationException | IOException | SAXException | ParseException | PropertyListFormatException | UnzipCanceledException e) {
savePaper(paper, e);
}
}
Timber.i("Finished service after download for paper: %d", paperId);
}
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:31,代码来源:DownloadFinishedPaperService.java
示例14: start
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
public File start() throws PropertyListFormatException, ParserConfigurationException, SAXException, ParseException, IOException, UnzipCanceledException {
unzipFile.getProgress()
.setProgressPercentageMax(50);
File result = unzipFile.start();
unzipFile.getProgress()
.setOffset(50);
checkCanceled();
Timber.i("... start parsing plist to check hashvals.");
if (!destinationDir.exists() || !destinationDir.isDirectory()) throw new FileNotFoundException("Directory not found");
File plistFile = new File(destinationDir, Paper.CONTENT_PLIST_FILENAME);
if (!plistFile.exists()) throw new FileNotFoundException("Plist not found");
paper.parsePlist(plistFile, false);
Map<String, String> hashVals = paper.getPlist()
.getHashVals();
if (hashVals != null) {
int count = 0;
for (Map.Entry<String, String> entry : hashVals.entrySet()) {
checkCanceled();
count++;
unzipFile.getProgress()
.setPercentage((count * 100) / hashVals.size());
unzipFile.notifyListeners(unzipFile.getProgress());
File checkFile = new File(destinationDir, entry.getKey());
if (!checkFile.exists()) throw new FileNotFoundException(checkFile.getName() + " not found");
else {
try {
if (!HashHelper.verifyHash(checkFile, entry.getValue(), HashHelper.SHA_1))
throw new FileNotFoundException("Wrong hash for file " + checkFile.getName());
} catch (NoSuchAlgorithmException e) {
Timber.w(e);
}
}
}
} else Timber.w("No hash values found in Plist");
checkCanceled();
Timber.i("... finished");
return result;
}
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:39,代码来源:UnzipPaper.java
示例15: parseTpaper
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
private static ImportMetadata parseTpaper(InputStream is) throws ParserConfigurationException, ParseException, SAXException, PropertyListFormatException, IOException {
Paper paper = new Paper();
paper.parsePlist(is, false);
if (paper.getPlist() != null) {
ImportMetadata result = new ImportMetadata();
result.setType(TYPE.TPAPER);
result.setBookId(paper.getPlist()
.getBookId());
result.setArchive(paper.getPlist().getArchiveUrl());
parseTitleAndDateFromBookId(result,paper.getPlist()
.getBookId());
return result;
}
return null;
}
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:16,代码来源:ImportMetadata.java
示例16: account
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
public static Account account(byte[] bs) {
try {
NSDictionary dict = (NSDictionary) PropertyListParser.parse(bs);
return account(dict);
} catch (IOException | PropertyListFormatException | ParseException | ParserConfigurationException | SAXException ex) {
throw new IllegalArgumentException(ex);
}
}
开发者ID:horrorho,项目名称:InflatableDonkey,代码行数:9,代码来源:Accounts.java
示例17: parse
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
public static Optional<NSObject> parse(byte[] data) {
try {
NSObject nsObject = PropertyListParser.parse(data);
return Optional.of(nsObject);
} catch (IOException | PropertyListFormatException | ParseException | ParserConfigurationException | SAXException ex) {
logger.warn("-- parse() - failed to parse NSObject data: 0x{}", Hex.toHexString(data));
return Optional.empty();
}
}
开发者ID:horrorho,项目名称:InflatableDonkey,代码行数:11,代码来源:PListsLegacy.java
示例18: parseLegacy
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
@Deprecated
public static <T> T parseLegacy(byte[] data) {
try {
return (T) PropertyListParser.parse(data);
} catch (ClassCastException |
IOException |
PropertyListFormatException |
ParseException |
ParserConfigurationException |
SAXException ex) {
throw new IllegalArgumentException("failed to parse property list", ex);
}
}
开发者ID:horrorho,项目名称:InflatableDonkey,代码行数:16,代码来源:PListsLegacy.java
示例19: parseNSObject
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
static Optional<NSObject> parseNSObject(byte[] data) {
try {
NSObject nsObject = PropertyListParser.parse(data);
return Optional.of(nsObject);
} catch (IOException | PropertyListFormatException | ParseException | ParserConfigurationException |
SAXException ex) {
logger.warn("-- parseNSObject() - failed to parse data: {} 0x{}", ex.getMessage(), Hex.toHexString(data));
return Optional.empty();
}
}
开发者ID:horrorho,项目名称:InflatableDonkey,代码行数:12,代码来源:NSDictionaries.java
示例20: parse
import com.dd.plist.PropertyListFormatException; //导入依赖的package包/类
static <T> T parse(byte[] data) throws BadDataException {
try {
return (T) PropertyListParser.parse(data);
} catch (ClassCastException |
IOException |
PropertyListFormatException |
ParseException |
ParserConfigurationException |
SAXException ex) {
throw new BadDataException("Failed to parse property list", ex);
}
}
开发者ID:horrorho,项目名称:LiquidDonkey,代码行数:15,代码来源:PropertyLists.java
注:本文中的com.dd.plist.PropertyListFormatException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论