Class RemoteRepositoryProvider

java.lang.Object
org.omegat.core.team2.RemoteRepositoryProvider

public class RemoteRepositoryProvider extends 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 Details

  • Constructor Details

  • Method Details

    • isManaged

      public boolean isManaged()
    • setForceExcludesFromProjectProperties

      public void setForceExcludesFromProjectProperties(ProjectProperties props)
    • getTeamSettings

      public ProjectTeamSettings getTeamSettings()
    • isUnderMapping

      public boolean isUnderMapping(String path)
      Checks if path is under mapping.
    • cleanPrepared

      public void cleanPrepared() throws IOException
      Throws:
      IOException
    • toPrepared

      public File toPrepared(File inFile) throws IOException
      Saves file into 'prepared' dir.
      Throws:
      IOException
    • switchAllToLatest

      public void switchAllToLatest() throws Exception
      Switch all repositories into latest version. Will continue in the event of an error, unless that error is a IRemoteRepository2.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:
      Exception
    • switchToVersion

      public File switchToVersion(String filePath, @Nullable @Nullable String version) throws 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:
      Exception
    • commitFileAfterVersion

      public String commitFileAfterVersion(String path, String commentText, String... onVersions) throws Exception
      Commit specific file after rebase. Used for omegat/project_save.tmx, glossaries, etc.
      Throws:
      Exception
    • commitFiles

      public void commitFiles(String path, String commentText) throws Exception
      Commit set of files without rebase - just local version. Used for target/*, etc.
      Throws:
      Exception
    • copyFilesFromReposToProject

      public void copyFilesFromReposToProject(String localPath) throws 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:
      IOException
    • copyFilesFromReposToProject

      public void copyFilesFromReposToProject(String localPath, String postfix, boolean propagateDelete) throws 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:
      IOException
    • copyFilesFromProjectToRepos

      public void copyFilesFromProjectToRepos(String localPath, @Nullable @Nullable String eolConversionCharset) throws Exception
      Copy all mappings that under specified directory path into repository directory.
      Parameters:
      localPath - directory name or file name
      eolConversionCharset - not null if EOL conversion required. EOL will be converted to repository-specific for existing files, and to platform-specific for new files
      Throws:
      Exception
    • getVersion

      public String getVersion(String file) throws Exception
      Get version of specified file.
      Throws:
      Exception