Package org.omegat.core.team2
Class RemoteRepositoryProvider
- java.lang.Object
-
- org.omegat.core.team2.RemoteRepositoryProvider
-
public class RemoteRepositoryProvider extends java.lang.ObjectClass for process some repository commands. Path, local path, repository path can be directory or one file only. Directory should be declared like 'source/', file should be declared like 'source/text.po'.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREPO_GIT_SUBDIRstatic java.lang.StringREPO_PREPARE_SUBDIRstatic java.lang.StringREPO_SUBDIRstatic java.lang.StringREPO_SVN_SUBDIR
-
Constructor Summary
Constructors Constructor Description RemoteRepositoryProvider(java.io.File projectRoot, java.util.List<RepositoryDefinition> repositoriesDefinitions)RemoteRepositoryProvider(java.io.File projectRoot, java.util.List<RepositoryDefinition> repositoriesDefinitions, ProjectProperties props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanPrepared()java.lang.StringcommitFileAfterVersion(java.lang.String path, java.lang.String commentText, java.lang.String... onVersions)Commit specific file after rebase.voidcommitFiles(java.lang.String path, java.lang.String commentText)Commit set of files without rebase - just local version.voidcopyFilesFromProjectToRepos(java.lang.String localPath, java.lang.String eolConversionCharset)Copy all mappings that under specified directory path into repository directory.voidcopyFilesFromReposToProject(java.lang.String localPath)Copies all files under specified path that are mapped to local directory.voidcopyFilesFromReposToProject(java.lang.String localPath, java.lang.String postfix, boolean propagateDelete)Copies all files under specified path that are mapped to local directory.ProjectTeamSettingsgetTeamSettings()java.lang.StringgetVersion(java.lang.String file)Get version of specified file.booleanisUnderMapping(java.lang.String path)Checks if path is under mapping.voidsetForceExcludesFromProjectProperties(ProjectProperties props)voidswitchAllToLatest()Switch all repositories into latest version.java.io.FileswitchToVersion(java.lang.String filePath, java.lang.String version)Switch repository that contains path to specified version.java.io.FiletoPrepared(java.io.File inFile)Saves file into 'prepared' dir.
-
-
-
Field Detail
-
REPO_SUBDIR
public static final java.lang.String REPO_SUBDIR
- See Also:
- Constant Field Values
-
REPO_PREPARE_SUBDIR
public static final java.lang.String REPO_PREPARE_SUBDIR
- See Also:
- Constant Field Values
-
REPO_GIT_SUBDIR
public static final java.lang.String REPO_GIT_SUBDIR
- See Also:
- Constant Field Values
-
REPO_SVN_SUBDIR
public static final java.lang.String REPO_SVN_SUBDIR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RemoteRepositoryProvider
public RemoteRepositoryProvider(java.io.File projectRoot, java.util.List<RepositoryDefinition> repositoriesDefinitions, ProjectProperties props) throws java.lang.Exception- Throws:
java.lang.Exception
-
RemoteRepositoryProvider
public RemoteRepositoryProvider(java.io.File projectRoot, java.util.List<RepositoryDefinition> repositoriesDefinitions) throws java.lang.Exception- Throws:
java.lang.Exception
-
-
Method Detail
-
setForceExcludesFromProjectProperties
public void setForceExcludesFromProjectProperties(ProjectProperties props)
-
getTeamSettings
public ProjectTeamSettings getTeamSettings()
-
isUnderMapping
public boolean isUnderMapping(java.lang.String path)
Checks if path is under mapping.
-
cleanPrepared
public void cleanPrepared() throws java.io.IOException- Throws:
java.io.IOException
-
toPrepared
public java.io.File toPrepared(java.io.File inFile) throws java.io.IOExceptionSaves file into 'prepared' dir.- Throws:
java.io.IOException
-
switchAllToLatest
public void switchAllToLatest() throws java.lang.ExceptionSwitch all repositories into latest version. Will continue in the event of an error, unless that error is aIRemoteRepository2.NetworkExceptionin which case it will throw immediately. If any other exceptions occur while updating the repos, the first will be thrown after all repos have been processed.- Throws:
java.lang.Exception
-
switchToVersion
public java.io.File switchToVersion(java.lang.String filePath, java.lang.String version) throws java.lang.ExceptionSwitch repository that contains path to specified version. If version is null, need to switch to latest version. Returns the path in the remote repository ( /path/to/omegatproject/.repositories/url/filepath- Throws:
java.lang.Exception
-
commitFileAfterVersion
public java.lang.String commitFileAfterVersion(java.lang.String path, java.lang.String commentText, java.lang.String... onVersions) throws java.lang.ExceptionCommit specific file after rebase. Used for omegat/project_save.tmx, glossaries, etc.- Throws:
java.lang.Exception
-
commitFiles
public void commitFiles(java.lang.String path, java.lang.String commentText) throws java.lang.ExceptionCommit set of files without rebase - just local version. Used for target/*, etc.- Throws:
java.lang.Exception
-
copyFilesFromReposToProject
public void copyFilesFromReposToProject(java.lang.String localPath) throws java.io.IOExceptionCopies all files under specified path that are mapped to local directory. If path is empty (i.e. full project), also file deletions since last copy are propagated, i.e. if remote repo has file deletions, those files are deleted locally as well.- Parameters:
localPath- directory name or file name- Throws:
java.io.IOException
-
copyFilesFromReposToProject
public void copyFilesFromReposToProject(java.lang.String localPath, java.lang.String postfix, boolean propagateDelete) throws java.io.IOExceptionCopies all files under specified path that are mapped to local directory.If propagateDelete flag is set true and path is empty (i.e. full project), also file deletions since last copy are propagated, i.e. if remote repo has file deletions, those files are deleted locally as well.
- Parameters:
localPath- directory name or file name- Throws:
java.io.IOException
-
copyFilesFromProjectToRepos
public void copyFilesFromProjectToRepos(java.lang.String localPath, java.lang.String eolConversionCharset) throws java.lang.ExceptionCopy all mappings that under specified directory path into repository directory.- Parameters:
localPath- directory name or file nameeolConversionCharset- not null if EOL conversion required. EOL will be converted to repository-specific for existing files, and to platform-specific for new files- Throws:
java.lang.Exception
-
getVersion
public java.lang.String getVersion(java.lang.String file) throws java.lang.ExceptionGet version of specified file.- Throws:
java.lang.Exception
-
-