@Path(value="/file") @Produces(value="application/octet-stream") @Consumes(value="application/octet-stream") public interface FileResource extends RestResource
Modifier and Type | Field and Description |
---|---|
static String |
ACCEPTED_TYPE_LIST_RESOURCE |
static String |
ACCEPTED_TYPES_RESOURCE |
static String |
DOWNLOAD_TEMPLATE |
static String |
FILE_DOWNLOAD_TEMPLATE |
static String |
FILE_RESOURCE
Deprecated.
|
static String |
FILE_TYPE_INFO_RESOURCE |
static String |
FILETYPE_RAW_SOURCE_DOCUMENT
Specifies to download the original source file that was uploaded,
byte-for-byte.
|
static String |
FILETYPE_TRANSLATED_APPROVED
Specifies to download a completed version of a translated document in the
original source format, showing only approved translations.
|
static String |
FILETYPE_TRANSLATED_APPROVED_AND_FUZZY
Specifies to download a preview of the translated document in the
original source format, showing all non-empty translations (even if not
approved).
|
static String |
SERVICE_PATH |
static String |
SOURCE_DOWNLOAD_TEMPLATE |
static String |
SOURCE_UPLOAD_TEMPLATE |
static String |
TRANSLATION_UPLOAD_TEMPLATE |
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)
Downloads a single translation file.
|
javax.ws.rs.core.Response |
fileTypeInfoList()
A list of document types supported by the server, along with their
default file extensions.
|
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.
|
static final String SERVICE_PATH
@Deprecated static final String FILE_RESOURCE
static final String ACCEPTED_TYPES_RESOURCE
static final String ACCEPTED_TYPE_LIST_RESOURCE
static final String FILE_TYPE_INFO_RESOURCE
static final String DOWNLOAD_TEMPLATE
static final String FILE_DOWNLOAD_TEMPLATE
static final String TRANSLATION_UPLOAD_TEMPLATE
static final String SOURCE_UPLOAD_TEMPLATE
static final String SOURCE_DOWNLOAD_TEMPLATE
static final String FILETYPE_RAW_SOURCE_DOCUMENT
static final String FILETYPE_TRANSLATED_APPROVED_AND_FUZZY
static final String FILETYPE_TRANSLATED_APPROVED
@Deprecated @GET @Path(value="/accepted_types") @Produces(value="text/plain") javax.ws.rs.core.Response acceptedFileTypes()
DocumentType#getSourceExtensions()
,
fileTypeInfoList()
@Deprecated @GET @Path(value="/accepted_document_types") @Produces(value="application/json") javax.ws.rs.core.Response acceptedFileTypeList()
DocumentType
,
fileTypeInfoList()
@GET @Path(value="/file_type_info") @Produces(value="application/json") javax.ws.rs.core.Response fileTypeInfoList()
FileTypeInfo
@POST @Path(value="/source/{projectSlug}/{iterationSlug}") @Consumes(value="multipart/form-data") @Produces(value="application/xml") javax.ws.rs.core.Response uploadSourceFile(@PathParam(value="projectSlug") String projectSlug, @PathParam(value="iterationSlug") String iterationSlug, @QueryParam(value="docId") String docId, DocumentFileUploadForm uploadForm)
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.@POST @Path(value="/translation/{projectSlug}/{iterationSlug}/{locale}") @Consumes(value="multipart/form-data") @Produces(value="application/xml") javax.ws.rs.core.Response uploadTranslationFile(@PathParam(value="projectSlug") String projectSlug, @PathParam(value="iterationSlug") String iterationSlug, @PathParam(value="locale") String localeId, @QueryParam(value="docId") String docId, @QueryParam(value="merge") String merge, DocumentFileUploadForm uploadForm)
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.@GET @Path(value="/source/{projectSlug}/{iterationSlug}/{fileType}") javax.ws.rs.core.Response downloadSourceFile(@PathParam(value="projectSlug") String projectSlug, @PathParam(value="iterationSlug") String iterationSlug, @PathParam(value="fileType") String fileType, @QueryParam(value="docId") String docId)
projectSlug
- iterationSlug
- fileType
- use 'raw' for original source if available, or 'pot' to
generate pot from source stringsdocId
- @GET @Path(value="/translation/{projectSlug}/{iterationSlug}/{locale}/{fileType}") javax.ws.rs.core.Response downloadTranslationFile(@PathParam(value="projectSlug") String projectSlug, @PathParam(value="iterationSlug") String iterationSlug, @PathParam(value="locale") String locale, @PathParam(value="fileType") String fileExtension, @QueryParam(value="docId") String docId)
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.@GET @Path(value="/download/{downloadId}") javax.ws.rs.core.Response download(@PathParam(value="downloadId") String downloadId)
downloadId
- The Zanata generated download id.Copyright © 2017 Zanata Project. All rights reserved.