@Path(value="/file") public class MockFileResource extends Object implements FileResource
ACCEPTED_TYPE_LIST_RESOURCE, ACCEPTED_TYPES_RESOURCE, DOWNLOAD_TEMPLATE, FILE_DOWNLOAD_TEMPLATE, FILE_RESOURCE, FILE_TYPE_INFO_RESOURCE, FILETYPE_GETTEXT, FILETYPE_GETTEXT_TEMPLATE, FILETYPE_OFFLINE_PO, FILETYPE_RAW_SOURCE_DOCUMENT, FILETYPE_TRANSLATED_APPROVED, FILETYPE_TRANSLATED_APPROVED_AND_FUZZY, SERVICE_PATH, SOURCE_DOWNLOAD_TEMPLATE, SOURCE_UPLOAD_TEMPLATE, TRANSLATION_UPLOAD_TEMPLATE
Constructor and Description |
---|
MockFileResource() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
acceptedFileTypeList()
Deprecated.
|
javax.ws.rs.core.Response |
acceptedFileTypes()
Deprecated.
|
javax.ws.rs.core.Response |
download(String downloadId)
Downloads a previously generated file.
|
javax.ws.rs.core.Response |
downloadSourceFile(String projectSlug,
String iterationSlug,
String fileType,
String docId)
Downloads a single source file.
|
javax.ws.rs.core.Response |
downloadTranslationFile(String projectSlug,
String iterationSlug,
String locale,
String fileExtension,
String docId,
boolean approvedOnly)
Downloads a single translation file.
|
javax.ws.rs.core.Response |
fileTypeInfoList()
Deprecated.
|
javax.ws.rs.core.Response |
uploadSourceFile(String projectSlug,
String iterationSlug,
String docId,
DocumentFileUploadForm uploadForm)
Upload a source file (or file chunk) to Zanata.
|
javax.ws.rs.core.Response |
uploadTranslationFile(String projectSlug,
String iterationSlug,
String localeId,
String docId,
String merge,
DocumentFileUploadForm uploadForm)
Upload a translation file (or file chunk) to Zanata.
|
@Deprecated public javax.ws.rs.core.Response acceptedFileTypes()
FileResource
acceptedFileTypes
in interface FileResource
DocumentType#getSourceExtensions()
,
FileResource.fileTypeInfoList()
@Deprecated public javax.ws.rs.core.Response acceptedFileTypeList()
FileResource
acceptedFileTypeList
in interface FileResource
DocumentType
,
FileResource.fileTypeInfoList()
@Deprecated public javax.ws.rs.core.Response fileTypeInfoList()
FileResource
fileTypeInfoList
in interface FileResource
FileTypeInfo
public javax.ws.rs.core.Response uploadSourceFile(String projectSlug, String iterationSlug, String docId, DocumentFileUploadForm uploadForm)
FileResource
uploadSourceFile
in interface FileResource
projectSlug
- The project slug where to store the document.iterationSlug
- The project version slug where to store the document.docId
- The full Document identifieruploadForm
- The multi-part form body for the file or chunk.public javax.ws.rs.core.Response uploadTranslationFile(String projectSlug, String iterationSlug, String localeId, String docId, String merge, DocumentFileUploadForm uploadForm)
FileResource
uploadTranslationFile
in interface FileResource
projectSlug
- The project slug where to store the document.iterationSlug
- The project version slug where to store the document.localeId
- The locale (language) for the translation file.docId
- The full Document identifier.merge
- Indicates whether to merge translations or overwrite all
translations with the contents of the uploaded file.uploadForm
- The multi-part form body for the file or chunk.public javax.ws.rs.core.Response downloadSourceFile(String projectSlug, String iterationSlug, String fileType, String docId)
FileResource
downloadSourceFile
in interface FileResource
fileType
- use 'raw' for original source if available, or 'pot' to
generate pot from source stringspublic javax.ws.rs.core.Response downloadTranslationFile(String projectSlug, String iterationSlug, String locale, String fileExtension, String docId, boolean approvedOnly)
FileResource
downloadTranslationFile
in interface FileResource
projectSlug
- Project identifier.iterationSlug
- Project iteration identifier.locale
- Translations for this locale will be contained in the
downloaded document.fileExtension
- File type to be downloaded. (Options: 'po', 'half_baked',
'baked')docId
- Document identifier to fetch translations for.approvedOnly
- If true, only include Approved translations (not Translated, Fuzzy or New).public javax.ws.rs.core.Response download(String downloadId)
FileResource
download
in interface FileResource
downloadId
- The Zanata generated download id.Copyright © 2018 Zanata Project. All rights reserved.