public abstract class DefaultDocumentManager extends Object implements DocumentManager
| Modifier and Type | Field and Description |
|---|---|
private static int |
DEFAULT_MAX_FILE_SIZE
Defines the default maximum file size, used if the "integration-sdk.data.filesize.editing.max"
or "integration-sdk.data.filesize.conversion.max" properties are not specified in "settings.properties".
|
private static String |
DOCS_FORMATS_JSON_PATH
Path to the matrix of formats supported by the ONLYOFFICE Editor.
|
private static List<Format> |
formats
Defines a list containing data about supported formats.
|
private SettingsManager |
settingsManager
|
| Constructor and Description |
|---|
DefaultDocumentManager() |
| Modifier and Type | Method and Description |
|---|---|
String |
getBaseName(String fileName)
Returns the file base name without the full path and extension.
|
List<String> |
getCompareFileExtensions()
Returns a list of extensions that can be used for the document comparison functions.
|
List<String> |
getConvertExtensionList(String fileName)
Returns a list of extensions that the document with the name specified in the request can be converted to.
|
String |
getDefaultConvertExtension(String fileName)
Returns the default OOXML extension to which the document with the name specified in the request should be
converted.
|
String |
getDefaultExtension(DocumentType documentType)
Returns the default OOXML extension by the specified document type.
|
abstract String |
getDocumentKey(String fileId,
boolean embedded)
Generates a unique document identifier used by the service to recognize the document.
|
abstract String |
getDocumentName(String fileId)
Returns the document name by file ID.
|
DocumentType |
getDocumentType(String fileName)
Returns the document type by the file name.
|
String |
getExtension(String fileName)
Returns the file extension from the file name.
|
List<Format> |
getFormats()
Returns a list of file formats (electronic documents, forms, spreadsheets, presentations) supported
by the ONLYOFFICE editors.
|
List<String> |
getInsertImageExtensions()
Returns a list of image extensions that can be inserted into the document.
|
Map<String,Boolean> |
getLossyEditableMap()
Returns a map of extensions that can be edited with the possible loss of information.
|
List<String> |
getMailMergeExtensions()
Returns a list of extensions that can be used for mail merge in the document.
|
long |
getMaxConversionFileSize()
Returns the maximum file size that can be converted in the ONLYOFFICE Conversion Service.
|
long |
getMaxFileSize()
Returns the maximum file size that can be opened in the ONLYOFFICE editor.
|
InputStream |
getNewBlankFile(String extension,
Locale locale)
Returns
InputStream of an empty file with the given extension and locale. |
boolean |
hasAction(String fileName,
String action)
Determines whether an action can be performed on a document with a name specified in the request.
|
protected static void |
init() |
boolean |
isEditable(String fileName)
Determines whether a document with a name specified in the request is editable.
|
boolean |
isFillable(String fileName)
Determines whether a document with a name specified in the request is fillable.
|
boolean |
isForm(InputStream inputStream)
Determines whether a file is form.
|
boolean |
isViewable(String fileName)
Determines whether a document with a name specified in the request is viewable.
|
private static final String DOCS_FORMATS_JSON_PATH
private static final int DEFAULT_MAX_FILE_SIZE
private SettingsManager settingsManager
public List<Format> getFormats()
DocumentManagergetFormats in interface DocumentManagerpublic abstract String getDocumentKey(String fileId, boolean embedded)
DocumentManagergetDocumentKey in interface DocumentManagerfileId - The file ID.embedded - Specifies if the editor is opened in the embedded mode (true) or not (false).public abstract String getDocumentName(String fileId)
DocumentManagergetDocumentName in interface DocumentManagerfileId - The file ID.public String getExtension(String fileName)
DocumentManagergetExtension in interface DocumentManagerfileName - The file name to get the extension.public String getBaseName(String fileName)
DocumentManagergetBaseName in interface DocumentManagerfileName - The file name to get the base name.public DocumentType getDocumentType(String fileName)
DocumentManagergetDocumentType in interface DocumentManagerfileName - The file name to get the document type.DocumentTypepublic boolean isEditable(String fileName)
DocumentManagerisEditable in interface DocumentManagerfileName - The file name.public boolean isViewable(String fileName)
DocumentManagerisViewable in interface DocumentManagerfileName - The file name.public boolean isFillable(String fileName)
DocumentManagerisFillable in interface DocumentManagerfileName - The file name.public boolean hasAction(String fileName, String action)
DocumentManagerhasAction in interface DocumentManagerfileName - The file name.action - An action to perform.public InputStream getNewBlankFile(String extension, Locale locale)
DocumentManagerInputStream of an empty file with the given extension and locale.getNewBlankFile in interface DocumentManagerextension - The file extension.locale - The file locale.InputStream of an empty file.public String getDefaultExtension(DocumentType documentType)
DocumentManagergetDefaultExtension in interface DocumentManagerdocumentType - The document type.DocumentTypepublic String getDefaultConvertExtension(String fileName)
DocumentManagergetDefaultConvertExtension in interface DocumentManagerfileName - The file name.public List<String> getConvertExtensionList(String fileName)
DocumentManagergetConvertExtensionList in interface DocumentManagerfileName - The file name.public Map<String,Boolean> getLossyEditableMap()
DocumentManagergetLossyEditableMap in interface DocumentManagerpublic List<String> getInsertImageExtensions()
DocumentManagergetInsertImageExtensions in interface DocumentManagerpublic List<String> getCompareFileExtensions()
DocumentManagergetCompareFileExtensions in interface DocumentManagerpublic List<String> getMailMergeExtensions()
DocumentManagergetMailMergeExtensions in interface DocumentManagerpublic long getMaxFileSize()
DocumentManagergetMaxFileSize in interface DocumentManagerpublic long getMaxConversionFileSize()
DocumentManagergetMaxConversionFileSize in interface DocumentManagerpublic boolean isForm(InputStream inputStream)
DocumentManagerisForm in interface DocumentManagerinputStream - The inputStream of file.protected static void init()
Copyright © 2023–2024. All rights reserved.