Pass through to provider RepositoryAdminSession.create_repository
424544
def create_repository(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinAdminSession.create_bin
        return Repository(
            self._provider_manager,
            self._get_provider_session('repository_admin_session').create_repository(*args, **kwargs),
            self._runtime,
            self._proxy)
722720
def create_repository(self):
        """"""
        repo = repository.Repository(
            self.repository_config['repository'],
            self.username,
            self.password,
            self.disable_progress_bar
        )
        repo.set_certificate_authority(self.cacert)
        repo.set_client_certificate(self.client_cert)
        return repo
390950
function Repository(loader, environment) {

    /**
     * The loader implementation.
     *
     * @var {FileLoader}
     * @protected
     */
    this.__loader = loader;

    /**
     * The current environment.
     *
     * @var {string}
     * @protected
     */
    this.__environment = environment;

    /**
     * All of the configuration items.
     *
     * @var {Array}
     * @protected
     */
    this.__items = [];

    /**
     * The after load callbacks for namespaces.
     *
     * @var {Array}
     * @protected
     */
    this.__afterLoad = [];

    // call super class constructor
    Repository.super_.call(this);

}
1336304
protected ArtifactStore createArtifactStore()
        throws MojoExecutionException
    {
        if ( repositories == null )
        {
            getLog().info( "Configuring Mock Repository Manager to proxy through this Maven instance" );
            return createProxyArtifactStore();
        }
        getLog().info( "Configuring Mock Repository Manager..." );
        List<ArtifactStore> stores = new ArrayList<ArtifactStore>();
        if ( repositories == null || repositories.length == 0 )
        {
            repositories = new ArtifactStoreFactory[]{ new ProxyRepo() };
        }
        FactoryHelper helper = createFactoryHelper();
        for ( ArtifactStoreFactory artifactStoreFactory : repositories )
        {
            if ( artifactStoreFactory instanceof FactoryHelperRequired )
            {
                ( (FactoryHelperRequired) artifactStoreFactory ).setFactoryHelper( helper );
            }
            getLog().info( "  " + artifactStoreFactory.toString() );
            stores.add( artifactStoreFactory.newInstance() );
        }
        ArtifactStore[] artifactStores = (ArtifactStore[]) stores.toArray( new ArtifactStore[stores.size()] );
        return artifactStores.length == 1 ? artifactStores[0] : new CompositeArtifactStore( artifactStores );
    }
746579
def _create(self, **kwargs):
        '''
        '''

        try:
            return super(Service, self)._create(**kwargs)
        except HTTPError as ex:
            if "The configuration was updated successfully but could not be " \
                    "retrieved" not in ex.response.text:
                raise

            # BIG-IP® will create in Common partition if none is given.
            # In order to create the uri properly in this class's load,
            # drop in Common as the partition in kwargs.
            if 'partition' not in kwargs:
                kwargs['partition'] = 'Common'
            # Pop all but the necessary load kwargs from the kwargs given to
            # create. Otherwise, load may fail.
            kwargs_copy = kwargs.copy()
            for key in kwargs_copy:
                if key not in self._meta_data['required_load_parameters']:
                    kwargs.pop(key)
            # If response was created successfully, do a local_update.
            # If not, call to overridden _load method via load
            return self.load(**kwargs)
717325
@Override
    public ExtensionRepository createRepository(ExtensionRepositoryDescriptor repositoryDescriptor)
        throws ExtensionRepositoryException
    {
        try {
            return new XWikiExtensionRepository(repositoryDescriptor, this, this.licenseManager, this.httpClientFactory,
                this.factory);
        } catch (Exception e) {
            throw new ExtensionRepositoryException("Failed to create repository [" + repositoryDescriptor + "]", e);
        }
    }
941677
def repository_get(name, local=False, hosts=None, profile=None):
    '''
    
    '''
    es = _get_instance(hosts, profile)

    try:
        return es.snapshot.get_repository(repository=name, local=local)
    except elasticsearch.NotFoundError:
        return None
    except elasticsearch.TransportError as e:
        raise CommandExecutionError("Cannot obtain repository {0}, server returned code {1} with message {2}".format(name, e.status_code, e.error))
428016
def _create(attributes, execute_hooks = true)
      resource = repository.scope { model.send(execute_hooks ? :create : :create!, default_attributes.merge(attributes)) }
      self << resource if resource.saved?
      resource
    end
639197
public Response backupRepository( ServletContext context, 
                                      HttpServletRequest request, 
                                      String repositoryName,
                                      BackupOptions options ) throws RepositoryException {
        final File backupLocation = resolveBackupLocation(context);

        Session session = getSession(request, repositoryName, null);
        String repositoryVersion = session.getRepository().getDescriptorValue(Repository.REP_VERSION_DESC).getString().replaceAll("\\.","");
        final String backupName = "modeshape_" + repositoryVersion + "_" + repositoryName + "_backup_" + DATE_FORMAT.format(new Date());
        final File backup = new File(backupLocation, backupName);
        if (!backup.mkdirs()) {
            throw new RuntimeException("Cannot create backup folder: " + backup);
        }
        logger.debug("Backing up repository '{0}' to '{1}', using '{2}'", repositoryName, backup, options);


        RepositoryManager repositoryManager = ((org.modeshape.jcr.api.Workspace)session.getWorkspace()).getRepositoryManager();
        repositoryManager.backupRepository(backup, options);
        final String backupURL;
        try {
            backupURL = backup.toURI().toURL().toString();
        } catch (MalformedURLException e) {
            //should never happen
            throw new RuntimeException(e);
        }
        JSONAble responseContent = new JSONAble() {
            @Override
            public JSONObject toJSON() throws JSONException {
                JSONObject object = new JSONObject();
                object.put("name", backupName);
                object.put("url", backupURL);
                return object;
            }
        }; 
        return Response.status(Response.Status.CREATED).entity(responseContent).build();
    }
186094
public void addBootstrapRepository(RepositoryAdmin repositoryAdmin, BundleContext context)
    {
        if (repositoryAdmin == null)
            return;
        String repository = context.getProperty("jbundle.repository.url");
        if (repository != null)
        	if (repository.length() > 0)
        		this.addRepository(repositoryAdmin, repository);

        //repository = "file:" + System.getProperty("user.home") + File.separator + ".m2" + File.separator  + "full-repository.xml";
        //this.addRepository(repositoryAdmin, repository);        
    }
524513
static InstallException create(RepositoryException e, Collection<String> featureNames, boolean installingAsset, RestRepositoryConnectionProxy proxy,
                                   boolean defaultRepo, boolean isOpenLiberty) {
        Throwable cause = e;
        Throwable rootCause = e;

        // Check the list of causes of the exception for connection issues
        while ((rootCause = cause.getCause()) != null && cause != rootCause) {
            if (rootCause instanceof UnknownHostException || rootCause instanceof FileNotFoundException || rootCause instanceof ConnectException) {
                return create(e, rootCause, proxy, defaultRepo);
            }
            cause = rootCause;
        }

        if (featureNames != null) {
            if (isCertPathBuilderException(cause))
                return createByKey(InstallException.CONNECTION_FAILED, e, defaultRepo ? "ERROR_FAILED_TO_CONNECT_CAUSED_BY_CERT" : "ERROR_FAILED_TO_CONNECT_REPOS_CAUSED_BY_CERT");

            String featuresListStr = InstallUtils.getFeatureListOutput(featureNames);
            InstallException ie;
            if (isOpenLiberty) {
                ie = create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(installingAsset ? "ERROR_FAILED_TO_RESOLVE_ASSETS" : "ERROR_FAILED_TO_RESOLVE_FEATURES_FOR_OPEN_LIBERTY",
                                                                           featuresListStr),
                            e);
            } else {
                ie = create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(installingAsset ? "ERROR_FAILED_TO_RESOLVE_ASSETS" : "ERROR_FAILED_TO_RESOLVE_FEATURES",
                                                                           featuresListStr),
                            e);
            }
            ie.setData(featuresListStr);

            return ie;

        } else
            return create(e);
    }
60803
def create_repository(self):
        
        schema = self.get_connection().get_schema_builder()

        with schema.create(self._table) as table:
            # The migrations table is responsible for keeping track of which of the
            # migrations have actually run for the application. We'll create the
            # table to hold the migration file's path as well as the batch ID.
            table.string("migration")
            table.integer("batch")
895244
def create(
        ctx,
        archive_name,
        authority_name,
        versioned=True,
        tag=None,
        helper=False):
    '''
    
    '''

    tags = list(tag)

    _generate_api(ctx)
    args, kwargs = _parse_args_and_kwargs(ctx.args)
    assert len(args) == 0, 'Unrecognized arguments: "{}"'.format(args)

    var = ctx.obj.api.create(
        archive_name,
        authority_name=authority_name,
        versioned=versioned,
        metadata=kwargs,
        tags=tags,
        helper=helper)

    verstring = 'versioned archive' if versioned else 'archive'
    click.echo('created {} {}'.format(verstring, var))
1320792
private ManageableRepository getRepository(RepositoryService rs) throws ResourceException
   {
      ManageableRepository mRepository = null;
      try
      {
         mRepository = repository == null ? rs.getCurrentRepository() : rs.getRepository(repository);
      }
      catch (Exception e)
      {
         throw new ResourceException("Could not get the "
            + (repository == null ? "current repository." : "repository '" + repository + "'"), e);
      }
      if (mRepository == null)
      {
         throw new ResourceException("Could not find the "
            + (repository == null ? "current repository." : "repository '" + repository + "'"));
      }
      if (LOG.isDebugEnabled())
      {
         LOG.debug("getRepository: repository = " + (repository == null ? "current." : repository));
      }

      return mRepository;
   }
1268710
public Session getAdminSession() throws RepositoryException {

        if(this.isActive(this.adminSession)){
            //perform a refresh to update the session to the latest repository version
            this.adminSession.refresh(false);
        } else {
            this.adminSession = this.repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
        }

        return this.adminSession;
    }
1246163
private CompletableFuture<Void> createRepository(CreateRepositoryCommand c) {
        return CompletableFuture.supplyAsync(() -> {
            projectManager.get(c.projectName()).repos().create(c.repositoryName(), c.timestamp(), c.author());
            return null;
        }, repositoryWorker);
    }
1134700
def get_resource_from_handle(self, resource_handle):
        
        repo_type = resource_handle.get("repository_type")
        location = resource_handle.get("location")
        if not (repo_type and location):
            raise ValueError("PackageRepositoryManager requires "
                             "resource_handle objects to have a "
                             "repository_type and location defined")
        path = "%s@%s" % (repo_type, location)
        repo = self.get_repository(path)
        resource = repo.get_resource_from_handle(resource_handle)
        return resource