Creates and returns the resource.

@return  The resource
432902
@Override
    protected HylaFAXClient createResourceImpl()
    {
        HylaFAXClient client=null;
        try
        {
            //create new instance
            client=this.createHylaFAXClient();
            
            //open host
            client.open(this.host,this.port);
            
            //set user
            client.user(this.userName);
            
            //set transfer mode and type
            client.mode(this.mode);
            client.type(this.type);
            
            //set password
            if(this.password!=null)
            {
                client.pass(this.password);
            }
            
            if(this.enableAdminOperations)
            {
                //enable admin operations
                client.admin(this.password);
            }
        }
        catch(RuntimeException exception)
        {
            //release client
            this.releaseResource(client);

            throw exception;
        }
        catch(Exception exception)
        {
            //release client
            this.releaseResource(client);

            throw new FaxException("General error.",exception);
        }

        return client;
    }
43114
public Configuration createFromResource(String resourceName) {
        Exceptions.nullArgument("resourceName", resourceName);

        Configuration configuration;
        try {
            InputStream stream = null;
            try {
                stream = Utils.openResourceStream(resourceName);

                if (stream != null) {
                    configuration = create(stream);
                } else {
                    throw new TextProcessorFactoryException("Can't find or open resource \"" + resourceName + "\".");
                }
            } finally {
                if (stream != null) {
                    stream.close();
                }
            }
        } catch (IOException e) {
            throw new TextProcessorFactoryException(e);
        }

        return configuration;
    }
883884
protected function get_resource() {
		$resource = null;
		if (isset($_GET[$this->parent_name]))
			$resource = $this->sql->select($this->request);
		else
			$resource = $this->sql->get_variants($this->config->relation_id['name'], $this->request);
		return $resource;
	}
570650
public static ResourceUtil getInstance() {

    if (instance == null) {
      ResourceUtilImpl impl = null;
      synchronized (ResourceUtilImpl.class) {
        if (instance == null) {
          impl = new ResourceUtilImpl();
          impl.initialize();
          instance = impl;
        }
      }
    }
    return instance;
  }
228074
public static Resource newResource(URL url)
        throws IOException
    {
        if (url==null)
            return null;

        String urls=url.toExternalForm();
        if( urls.startsWith( "file:"))
        {
            try
            {
                FileResource fileResource= new FileResource(url);
                return fileResource;
            }
            catch(Exception e)
            {
                log.debug(LogSupport.EXCEPTION,e);
                return new BadResource(url,e.toString());
            }
        }
        else if( urls.startsWith( "jar:file:"))
        {
            return new JarFileResource(url);
        }
        else if( urls.startsWith( "jar:"))
        {
            return new JarResource(url);
        }

        return new URLResource(url,null);
    }
159457
public java.lang.String getResource() {
    java.lang.Object ref = resource_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      resource_ = s;
      return s;
    }
  }
789434
public function create()
	{
		try
		{
			$this->client->send(new Request($this->uri->withPath($this->uri->getPath().'resources')
				->withQuery(http_build_query([
					'path' => $this->getPath()
				], null, '&')), 'PUT'));
			$this->setContents([]);
		}
		catch (\Exception $exc)
		{
			throw $exc;
		}

		return $this;
	}
292531
@Override
    public Object createResource(ResourceInfo info) throws Exception {
        ComponentMetaData cData = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
        if (cData != null)
            applications.add(cData.getJ2EEName().getApplication());

        return cloudantSvc.createResource(
                                          (String) props.get("databaseName"),
                                          (Boolean) props.get("create"),
                                          info == null ? ResourceInfo.AUTH_APPLICATION : info.getAuth(),
                                          info == null ? null : info.getLoginPropertyList());
    }
788775
@Nullable
    public static InputStream getResourceAsStream(@NotNull String resource) {
        final ClassLoader classLoader = FileUtils.class.getClassLoader();
        final InputStream inputStream = classLoader != null
                ? classLoader.getResourceAsStream(resource)
                : ClassLoader.getSystemResourceAsStream(resource);

        if (inputStream == null) {
            try {
                return new FileInputStream(resource);
            } catch (final FileNotFoundException e) {
                LOGGER.error("Unable to create an Input Stream for " + resource, e);
            }
        }
        return inputStream;
    }
619958
public static Resource create(@NotNull ResourceResolver resourceResolver, @Nullable String path, @NotNull String resourceType) {
    return create(resourceResolver, path, resourceType, ValueMap.EMPTY);
  }
278530
public function getResource()
    {
        if ($this->getEvent() && $this->event->getTarget() instanceof ResourceInterface) {
            return $this->event->getTarget();
        }

        return null;
    }
156578
def resource(self):
        
        if self._resource:
            return self._resource
        elif self.binding:
            return self.binding.resource
1323129
def createResource(self):
        
        pp = ixmantissa.IPublicPage(self.application, None)
        if pp is not None:
            warn(
            "Use the sharing system to provide public pages, not IPublicPage",
            category=DeprecationWarning,
            stacklevel=2)
            return pp.getResource()
        return SharingIndex(self.application.open())
844991
public function create()
    {
        $instance = self::createBraintreeGateway($this);
        $this->setId($instance->getId());
        return $instance;
    }
609442
public ReturnValue create() {
        if (forcedStatus == null) {
            retVal.withStatus(status);
        } else {
            retVal.withStatus(forcedStatus);
        }

        StringBuilder msg = new StringBuilder(pluginName).append(" : ").append(retVal.getStatus());
        if (!StringUtils.isEmpty(retValMessage)) {
            msg.append(" - ").append(retValMessage);
        }

        retVal.withMessage(msg.toString());

        return retVal;
    }
881825
def create(self, resource):
        
        schema = PackageSchema(exclude=('id', 'created', 'updated', 'test_count', 'agent_id', 'result_id'))
        json = self.service.encode(schema, resource)

        schema = PackageSchema()
        resp = self.service.create(self.base, json)
        return self.service.decode(schema, resp)
1344390
public ExternalXAResource createXAResource()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createXAResource");

        ExternalXAResource instance = new MSDelegatingXAResource(_ms, _persistence, getMaximumTransactionSize());

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createXAResource", "return="+instance);
        return instance;
    }