Class HTTPRemoteRepository

java.lang.Object
org.omegat.core.team2.impl.HTTPRemoteRepository
All Implemented Interfaces:
IRemoteRepository2

public class HTTPRemoteRepository extends Object implements IRemoteRepository2
HTTP/HTTPS repository connection implementation.

It can be used as read-only repository for retrieve sources, external TMX, glossaries, etc. Since HTTP protocol doesn't support multiple files, each URL should be mapped to separate file, i.e. directory mapping is not supported.

  • Constructor Details

    • HTTPRemoteRepository

      public HTTPRemoteRepository()
  • Method Details

    • loadPlugins

      public static void loadPlugins()
      Plugin loader.
    • unloadPlugins

      public static void unloadPlugins()
      Plugin unloader.
    • init

      public void init(RepositoryDefinition repo, File dir, ProjectTeamSettings teamSettings) throws Exception
      Description copied from interface: IRemoteRepository2
      Initialize repository provider.
      Specified by:
      init in interface IRemoteRepository2
      Parameters:
      repo - repository description instance
      dir - directory for store files
      teamSettings - team settings object for project
      Throws:
      Exception
    • getFileVersion

      public String getFileVersion(String file) throws Exception
      Use SHA-1 as a file version.
      Specified by:
      getFileVersion in interface IRemoteRepository2
      Throws:
      Exception
    • switchToVersion

      public void switchToVersion(String version) throws Exception
      Specified by:
      switchToVersion in interface IRemoteRepository2
      Throws:
      Exception
    • addForCommit

      public void addForCommit(String path) throws Exception
      Description copied from interface: IRemoteRepository2
      Add the specified file in preparation for commit (e.g. git add, svn add).
      Specified by:
      addForCommit in interface IRemoteRepository2
      Parameters:
      path - The relative path of the item from the root of the repo (should not start with a /)
      Throws:
      Exception - if error occurred
    • addForDeletion

      public void addForDeletion(String path) throws Exception
      Description copied from interface: IRemoteRepository2
      remove the specified file in preparation for commit (e.g. git rm, svn delete).
      Specified by:
      addForDeletion in interface IRemoteRepository2
      Parameters:
      path - The relative path of the item from the root of the repo (should not start with a /)
      Throws:
      Exception - if error occurred
    • getLocalDirectory

      public File getLocalDirectory()
      Description copied from interface: IRemoteRepository2
      Return directory where this repo is in.
      Specified by:
      getLocalDirectory in interface IRemoteRepository2
      Returns:
      The directory, e.g. /path/to/omegatdir/.repositories/https_site.com_myproject.git
    • getRecentlyDeletedFiles

      public String[] getRecentlyDeletedFiles()
      Description copied from interface: IRemoteRepository2
      Returns a list of files or directories (empty or not) that have been deleted since the last call to this function, relative to the repository root that has been checked out. If this function is called for the first time, it returns the empty list.
      Specified by:
      getRecentlyDeletedFiles in interface IRemoteRepository2
      Returns:
      An array of relative paths of deleted files.
    • commit

      public String commit(String[] onVersions, String comment) throws Exception
      Description copied from interface: IRemoteRepository2
      Commit to repository after specified version, or after any version if 'null' specified.
      Specified by:
      commit in interface IRemoteRepository2
      Parameters:
      onVersions - if version defined, then commit must be just after this version. Otherwise(if remote repository was updated after rebase), commit shouldn't be processed and should return null. If version is null, then commit can be after any version, i.e. previous version shouldn't be checked. It can be several versions defined since glossary will be committed after project_save.tmx.
      comment - comment for commit
      Returns:
      new version if commit was processed, or null if remote repository was updated by other user
      Throws:
      Exception