public class MetadataUtility extends Object
Represents different utilities classes for working with metadata.
Constructor and Description |
---|
MetadataUtility() |
Modifier and Type | Method and Description |
---|---|
static com.aspose.ms.System.IAsyncResult |
beginExtractMetadata(String path)
Begins the extract metadata.
|
static com.aspose.ms.System.IAsyncResult |
beginUpdateMetadata(String path,
Metadata[] metadataArray)
Begins the update metadata.
|
static void |
cleanMetadata(InputStream stream)
Removes all metadata from the
Stream . |
static void |
cleanMetadata(String path)
Removes all metadata from the file.
|
static MetadataPropertyCollection |
compareDoc(String path1,
String path2)
Deprecated.
|
static MetadataPropertyCollection |
comparePdf(String path1,
String path2)
Deprecated.
|
static MetadataPropertyCollection |
comparePpt(String path1,
String path2)
Deprecated.
|
static MetadataPropertyCollection |
compareXls(String path1,
String path2)
Deprecated.
|
static Metadata[] |
endExtractMetadata(com.aspose.ms.System.IAsyncResult asyncResult)
Ends the extract metadata.
|
static void |
endUpdateMetadata(com.aspose.ms.System.IAsyncResult asyncResult)
Ends the update metadata.
|
static MetadataPropertyCollection |
extractDocumentProperties(InputStream stream)
Gets document properties from the
Stream . |
static MetadataPropertyCollection |
extractDocumentProperties(String path)
Gets document properties from existing file.
|
static Metadata[] |
extractMetadata(InputStream stream)
Gets array of
Metadata from the Stream . |
static Metadata[] |
extractMetadata(String path)
Gets array of
Metadata from existing file. |
static Metadata |
extractSpecificMetadata(InputStream stream,
int metadataType)
Extracts specific
Metadata from the Stream . |
static Metadata |
extractSpecificMetadata(String path,
int metadataType)
Extracts specific
Metadata from the file. |
static XmpPacketWrapper |
extractXmpPackage(InputStream stream)
Extracts
XmpPacketWrapper from the Stream . |
static XmpPacketWrapper |
extractXmpPackage(String path)
Extracts
XmpPacketWrapper from the existing path. |
static XmpProperties |
extractXmpProperties(InputStream stream)
Extracts
XmpProperties from the Stream . |
static XmpProperties |
extractXmpProperties(String path)
Extracts
XmpProperties from the existing path. |
static String |
getMimeType(InputStream stream)
Gets MIME type of the stream.
|
static String |
getMimeType(String path)
Gets MIME type of the specific file.
|
static boolean |
isProtected(InputStream stream)
Determines whether the specified document is protected by password.
|
static boolean |
isProtected(String path)
Determines whether the specified document is protected by password.
|
static void |
updateMetadata(InputStream stream,
Metadata metadata)
Updates metadata in the
Stream . |
static void |
updateMetadata(InputStream stream,
Metadata[] metadataArray)
Updates array in the
Stream . |
static void |
updateMetadata(String path,
Metadata metadata)
Updates the metadata.
|
static void |
updateMetadata(String path,
Metadata[] metadataArray)
Updates the metadata.
|
static void |
updateMetadata(String path,
Metadata[] metadataArray,
String destinationPath)
Updates the metadata.
|
static void |
updateMetadata(String path,
Metadata metadata,
String destinationPath)
Updates the metadata.
|
public static Metadata[] extractMetadata(InputStream stream)
Gets array of Metadata
from the Stream
.
stream
- File stream.Metadata
presented in file.com.aspose.ms.System.ArgumentNullException
- Stream could not be null.public static Metadata[] extractMetadata(String path)
Gets array of Metadata
from existing file.
path
- Absolute path to file.Metadata
presented in file.com.aspose.ms.System.ArgumentNullException
- Path could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static com.aspose.ms.System.IAsyncResult beginExtractMetadata(String path)
Begins the extract metadata.
path
- Absolute path to the file.IAsyncResult
.public static Metadata[] endExtractMetadata(com.aspose.ms.System.IAsyncResult asyncResult)
Ends the extract metadata.
asyncResult
- The asynchronous result.Metadata
.com.aspose.ms.System.ArgumentNullException
- Could not be null.com.aspose.ms.System.InvalidOperationException
- Invalid token.public static Metadata extractSpecificMetadata(InputStream stream, int metadataType)
Extracts specific Metadata
from the Stream
.
stream
- File stream.metadataType
- Type of the metadata.Metadata
if metadata found in file; otherwise null.com.aspose.ms.System.ArgumentNullException
- Stream could not be null.public static Metadata extractSpecificMetadata(String path, int metadataType)
Extracts specific Metadata
from the file.
path
- Absolute path to the file.metadataType
- Type of the metadata.Metadata
if metadata found in file; otherwise null.com.aspose.ms.System.ArgumentNullException
- Could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static MetadataPropertyCollection extractDocumentProperties(InputStream stream)
Gets document properties from the Stream
.
stream
- File stream.MetadataPropertyCollection
presented in file.com.aspose.ms.System.ArgumentNullException
- Stream could not be null.public static MetadataPropertyCollection extractDocumentProperties(String path)
Gets document properties from existing file.
path
- Absolute path to file.MetadataPropertyCollection
presented in file.com.aspose.ms.System.ArgumentNullException
- Could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static XmpPacketWrapper extractXmpPackage(InputStream stream)
Extracts XmpPacketWrapper
from the Stream
.
stream
- File stream.XmpPacketWrapper
if metadata found; otherwise null.com.aspose.ms.System.ArgumentNullException
- Stream could not be null.public static XmpPacketWrapper extractXmpPackage(String path)
Extracts XmpPacketWrapper
from the existing path.
path
- Absolute path to file.XmpPacketWrapper
if metadata found; otherwise null.com.aspose.ms.System.ArgumentNullException
- Path could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static XmpProperties extractXmpProperties(InputStream stream)
Extracts XmpProperties
from the Stream
.
stream
- File stream.XmpProperties
if metadata found; otherwise null.com.aspose.ms.System.ArgumentNullException
- Stream could not be null.public static XmpProperties extractXmpProperties(String path)
Extracts XmpProperties
from the existing path.
path
- Absolute path to file.XmpProperties
if metadata found; otherwise null.com.aspose.ms.System.ArgumentNullException
- Path could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static void cleanMetadata(InputStream stream)
Removes all metadata from the Stream
.
stream
- File stream.
public static void cleanMetadata(String path)
Removes all metadata from the file.
path
- Absolute path to the file.
com.aspose.ms.System.ArgumentNullException
- Path could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static com.aspose.ms.System.IAsyncResult beginUpdateMetadata(String path, Metadata[] metadataArray)
Begins the update metadata.
path
- Absolute path to file.metadataArray
- The metadata array.IAsyncResult
.public static void endUpdateMetadata(com.aspose.ms.System.IAsyncResult asyncResult)
Ends the update metadata.
asyncResult
- The asynchronous result.com.aspose.ms.System.ArgumentNullException
- IAsyncResult could not be null.com.aspose.ms.System.InvalidOperationException
- Invalid token.public static void updateMetadata(InputStream stream, Metadata[] metadataArray)
Updates array in the Stream
.
stream
- The stream.metadataArray
- The metadata array.
com.aspose.ms.System.ArgumentNullException
- Stream could not be null.public static void updateMetadata(String path, Metadata[] metadataArray)
Updates the metadata.
path
- Absolute path to the updating file.metadataArray
- Array of Metadata
.
com.aspose.ms.System.ArgumentNullException
- Path could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static void updateMetadata(String path, Metadata[] metadataArray, String destinationPath)
Updates the metadata.
path
- Absolute path to the updating file.metadataArray
- Array of Metadata
.destinationPath
- Absolute path to the resulting file. If null - option is skipped.
com.aspose.ms.System.ArgumentNullException
- Path could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static void updateMetadata(InputStream stream, Metadata metadata)
Updates metadata in the Stream
.
stream
- The stream.metadata
- Instance of Metadata
.
com.aspose.ms.System.ArgumentNullException
- Stream could not be null.public static void updateMetadata(String path, Metadata metadata)
Updates the metadata.
path
- Absolute path to the updating file.metadata
- Instance of Metadata
.
com.aspose.ms.System.ArgumentNullException
- Path could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static void updateMetadata(String path, Metadata metadata, String destinationPath)
Updates the metadata.
path
- Absolute path to the updating file.metadata
- Instance of Metadata
.destinationPath
- Absolute path to the resulting file. If null - option is skipped.
com.aspose.ms.System.ArgumentNullException
- Path could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.@Deprecated public static MetadataPropertyCollection compareDoc(String path1, String path2)
Compares Word documents and returns differences.
path1
- Absolute path to the Word document.path2
- Absolute path to the compared document.
@Deprecated public static MetadataPropertyCollection comparePdf(String path1, String path2)
Compares PDF documents and returns differences.
path1
- Absolute path to the PDF document.path2
- Absolute path to the compared document.
@Deprecated public static MetadataPropertyCollection comparePpt(String path1, String path2)
Compares PowerPoint documents and returns differences.
path1
- Absolute path to the PowerPoint document.path2
- Absolute path to the compared document.
@Deprecated public static MetadataPropertyCollection compareXls(String path1, String path2)
Compares XlsFormat
documents and returns differences.
path1
- Absolute path to the Excel document.path2
- Absolute path to the compared document.
public static boolean isProtected(String path)
Determines whether the specified document is protected by password.
path
- Absolute path to the document.true
if document is protected by password; otherwise false
.com.aspose.ms.System.ArgumentNullException
- Path could not be null.com.aspose.ms.System.IO.FileNotFoundException
- Requested file not found.public static boolean isProtected(InputStream stream)
Determines whether the specified document is protected by password.
stream
- Document stream.com.aspose.ms.System.ArgumentNullException
- Stream could not be null.public static String getMimeType(String path)
Gets MIME type of the specific file.
path
- Absolute path to the file.public static String getMimeType(InputStream stream)
Gets MIME type of the stream.
stream
- File stream.Copyright © 2017. All rights reserved.