public abstract class AbstractPushStrategy extends AbstractCommonPushStrategy<PushOptions>
Constructor and Description |
---|
AbstractPushStrategy(org.zanata.rest.StringSet extensions,
String fileExtension) |
Modifier and Type | Method and Description |
---|---|
protected String |
docNameToFilename(String docName) |
protected String |
docNameToFilename(String docName,
LocaleMapping locale) |
abstract Set<String> |
findDocNames(File srcDir,
List<String> includes,
List<String> excludes,
boolean useDefaultExclude,
boolean caseSensitive,
boolean excludeLocaleFilenames) |
org.zanata.rest.StringSet |
getExtensions() |
String |
getFileExtension() |
String[] |
getSrcFiles(File srcDir,
List<String> includes,
List<String> excludes,
boolean excludeLocaleFilenames,
boolean useDefaultExclude,
boolean isCaseSensitive)
Scan srcDir to return a list of all source files.
|
void |
init() |
boolean |
isTransOnly()
Indicates if this strategy must work without access to source files.
|
abstract org.zanata.rest.dto.resource.Resource |
loadSrcDoc(File sourceDir,
String docName) |
abstract void |
visitTranslationResources(String docName,
org.zanata.rest.dto.resource.Resource srcDoc,
PushCommand.TranslationResourcesVisitor visitor) |
getOpts, getSrcFiles, setPushOptions
public AbstractPushStrategy(org.zanata.rest.StringSet extensions, String fileExtension)
public abstract Set<String> findDocNames(File srcDir, List<String> includes, List<String> excludes, boolean useDefaultExclude, boolean caseSensitive, boolean excludeLocaleFilenames) throws IOException
IOException
public abstract org.zanata.rest.dto.resource.Resource loadSrcDoc(File sourceDir, String docName) throws IOException
IOException
public abstract void visitTranslationResources(String docName, org.zanata.rest.dto.resource.Resource srcDoc, PushCommand.TranslationResourcesVisitor visitor) throws IOException
IOException
public boolean isTransOnly()
public String[] getSrcFiles(File srcDir, List<String> includes, List<String> excludes, boolean excludeLocaleFilenames, boolean useDefaultExclude, boolean isCaseSensitive)
srcDir
- base directory in which to find source filesincludes
- empty to find all source files, non-empty to find only the
documents in this listexcludes
- excludeLocaleFilenames
- adds entries to excludes to ignore any file with a locale id
suffix before the file extension.useDefaultExclude
- true to also exclude a set of default excludes for common temp
file and source control filenamesisCaseSensitive
- case sensitive search for includes and excludes optionsprotected String docNameToFilename(String docName, LocaleMapping locale)
public org.zanata.rest.StringSet getExtensions()
public String getFileExtension()
public void init()
Copyright © 2014 Zanata Project. All rights reserved.