Package org.omegat.core.team2
Class RemoteRepositoryProvider
- java.lang.Object
-
- org.omegat.core.team2.RemoteRepositoryProvider
-
public class RemoteRepositoryProvider extends java.lang.Object
Class 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.String
REPO_GIT_SUBDIR
static java.lang.String
REPO_PREPARE_SUBDIR
static java.lang.String
REPO_SUBDIR
static java.lang.String
REPO_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 void
cleanPrepared()
java.lang.String
commitFileAfterVersion(java.lang.String path, java.lang.String commentText, java.lang.String... onVersions)
Commit specific file after rebase.void
commitFiles(java.lang.String path, java.lang.String commentText)
Commit set of files without rebase - just local version.void
copyFilesFromProjectToRepos(java.lang.String localPath, java.lang.String eolConversionCharset)
Copy all mappings that under specified directory path into repository directory.void
copyFilesFromReposToProject(java.lang.String localPath)
Copies all files under specified path that are mapped to local directory.void
copyFilesFromReposToProject(java.lang.String localPath, java.lang.String postfix, boolean propagateDelete)
Copies all files under specified path that are mapped to local directory.ProjectTeamSettings
getTeamSettings()
java.lang.String
getVersion(java.lang.String file)
Get version of specified file.boolean
isUnderMapping(java.lang.String path)
Checks if path is under mapping.void
setForceExcludesFromProjectProperties(ProjectProperties props)
void
switchAllToLatest()
Switch all repositories into latest version.java.io.File
switchToVersion(java.lang.String filePath, java.lang.String version)
Switch repository that contains path to specified version.java.io.File
toPrepared(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.IOException
Saves file into 'prepared' dir.- Throws:
java.io.IOException
-
switchAllToLatest
public void switchAllToLatest() throws java.lang.Exception
Switch all repositories into latest version. Will continue in the event of an error, unless that error is aIRemoteRepository2.NetworkException
in 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.Exception
Switch 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.Exception
Commit 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.Exception
Commit 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.IOException
Copies 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.IOException
Copies 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.Exception
Copy 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.Exception
Get version of specified file.- Throws:
java.lang.Exception
-
-