Interface ILocallySynchronizableRepository

All Known Subinterfaces:
ISourceRepository

public interface ILocallySynchronizableRepository
Simple structured repository which can be synchronized locally.

Does not support writing changes back to the repository.

It is permitted to operate on subfolders of previously synchronized folders:

 ...synchronizeLocal("/x", "/local/x", ...);
 ...synchronizeLocal("/x/y/z", "/local/x/y/z", ...);
 
Version:
$Revision$ $Date$
Author:
Stepan Roh, Polarion Software
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    revertLocal(ILocation location, File localDir, boolean recurse, boolean removeUnmanaged)
    Revert local changes done in synchronized local copy.
    void
    synchronizeLocal(ILocation location, File localDir, boolean recurse, Collection includes)
    Synchronize given folder location to given local directory.
  • Method Details

    • synchronizeLocal

      void synchronizeLocal(ILocation location, File localDir, boolean recurse, Collection includes) throws IOException
      Synchronize given folder location to given local directory.

      Will create local directory if needed.

      Note that folder per-se is not synchronized, only its contents are (synchronizing folder "/some/folder" which contains file "x" will produce only file "x" in local directory and not folder "folder").

      Will download latest changes if local directory was already synchronized. Timestamps of files which did not change may be modified. Unmanaged files (those created only locally) are always left intact.

      It is unspecified what happens if local directory is synchronized with different location than before - it may even result in unsynchronizable local directory which will have to be deleted and resynchronized.

      It is unspecified what happens if local directory is synchronized recursively and then not recursively (or vice-versa). It may result in ignorance of recursivness setting after first synchronization.

      It is unspecified what happens if local directory has changes in managed (downloaded from repository) files - however it is ensured that local directory will still be synchronizable, although some changes done in repository could be omitted from synchronization. Use revertLocal(ILocation, File, boolean, boolean) to revert local changes.

      It is ensured that given included locations will be synchronized, however other files (previously synchronized, but not included now, or even new ones), may be synchronized too.

      Incudes may be ignored by implementation.

      Implementation may not support removal of local files if they are removed from repository.

      It is permitted to synchronize with different revision.

      If recursivness is not requested, subfolders may be created as empty or may be entirely ignored.

      Parameters:
      location - folder location
      localDir - local directory
      recurse - true if subfolders of given folder should be synchronized too
      includes - Collection of ILocations (relative to given folder location or absolute) which should be synchronized (pass null to include all)
      Throws:
      IllegalArgumentException - if location is null
      IllegalArgumentException - if location is relative
      IllegalArgumentException - if localDir is null
      IOException - if error occurs or location is not folder
    • revertLocal

      void revertLocal(ILocation location, File localDir, boolean recurse, boolean removeUnmanaged) throws IOException
      Revert local changes done in synchronized local copy.

      Will not remove new (unmanaged/unsynchronized) files unless told to do so.

      It is unspecified what happens if local directory is reverted with different location than it was synchronized with - it may even result in unsynchronizable/unrevertable local directory which will have to be deleted and resynchronized.

      Revision in given location may or may not be ignored. Changes may be reverted to last synchronized state (in which case revision is ignored) or to the revision given by location (or to last revision if location lacks it).

      It is not specified whether unmanaged folders are removed if recursivness is not requested. It is possible that they will not be removed, will be removed only if empty or will be removed even if not empty.

      Parameters:
      location - folder location
      localDir - local directory
      recurse - true if subfolders of given folder should be synchronized too
      removeUnmanaged - true if unmanaged files should be removed
      Throws:
      IllegalArgumentException - if location is null
      IllegalArgumentException - if location is relative
      IllegalArgumentException - if localDir is null
      IOException - if error occurs, location is not folder or local directory is not synchronized