Class ResourceRepositoryImpl

  • All Implemented Interfaces:
    ResourceRepository

    public class ResourceRepositoryImpl
    extends java.lang.Object
    implements ResourceRepository
    This class implements a hidden repository. This repo is kept in a text file that is under scm control. Files are fetched on demand. The idea is that bnd will bootstrap from this repo and downloads plugins. These plugins then provide faces on this hidden repository.
    • Constructor Detail

      • ResourceRepositoryImpl

        public ResourceRepositoryImpl()
    • Method Detail

      • delete

        void delete​(byte[] id)
             throws java.lang.Exception
        Delete a resource from the text file (not from the cache)
        Throws:
        java.lang.Exception
      • delete

        public boolean delete​(java.lang.String repoId,
                              byte[] id)
                       throws java.lang.Exception
        Specified by:
        delete in interface ResourceRepository
        Throws:
        java.lang.Exception
      • deleteCache

        public boolean deleteCache​(byte[] id)
                            throws java.lang.Exception
        Delete a cache entry
        Specified by:
        deleteCache in interface ResourceRepository
        Throws:
        java.lang.Exception
      • setDirty

        private void setDirty()
        Set dirty for save. Save is a noop if not dirty
      • download0

        void download0​(java.net.URI url,
                       java.io.File path,
                       byte[] sha)
                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • sleep

        private boolean sleep​(int i)
        Sleep function that does not throw InterruptedException
        Parameters:
        i -
      • save

        private void save()
                   throws java.lang.Exception
        Save the index file.
        Throws:
        java.lang.Exception
      • setReporter

        public void setReporter​(Reporter processor)
      • setIndexFile

        public void setIndexFile​(java.io.File file)
      • setCache

        public void setCache​(java.io.File cache)
      • setExecutor

        public void setExecutor​(java.util.concurrent.Executor executor)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setURLConnector

        public void setURLConnector​(URLConnectionHandler connector)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object