public static File getClasspathForClass(Class<?> targetClass) {
URI location;
try {
CodeSource codeSource = targetClass.getProtectionDomain().getCodeSource();
if (codeSource != null && codeSource.getLocation() != null) {
location = codeSource.getLocation().toURI();
if (location.getScheme().equals("file")) {
return new File(location);
}
}
if (targetClass.getClassLoader() != null) {
String resourceName = targetClass.getName().replace('.','/') + ".class";
URL resource = targetClass.getClassLoader().getResource(resourceName);
if (resource != null) {
return getClasspathForResource(resource,resourceName);
}
}
throw new GradleException(String.format("Cannot determine classpath for class %s.",targetClass.getName()));
} catch (URISyntaxException e) {
throw UncheckedException.throwAsUncheckedException(e);
}
}
@Test
public void testZipRepoContent() throws Exception {
Path repoDir = Paths.get(getClass().getResource(repository).toURI());
Path mtarZip = null;
try {
mtarZip = step.zipRepoContent(repoDir.toAbsolutePath());
URI jarMtarUri = URI.create("jar:" + mtarZip.toAbsolutePath().toUri().toString());
try (FileSystem mtarFS = FileSystems.newFileSystem(jarMtarUri,new HashMap<>())) {
Path mtarRoot = mtarFS.getRootDirectories().iterator().next();
assertFalse(Files.exists(mtarRoot.resolve(".git")));
assertFalse(Files.exists(mtarRoot.resolve(".gitignore")));
assertTrue(Files.exists(mtarRoot.resolve("a/cool-script.script")));
assertTrue(Files.exists(mtarRoot.resolve("meta-inf/mtad.yaml")));
assertTrue(Files.exists(mtarRoot.resolve("meta-inf/MANIFEST.MF")));
}
} finally {
if (mtarZip != null) {
Files.deleteIfExists(mtarZip);
}
}
}
项目:JRediClients
文件:ClusterConnectionManager.java
private void checkSlaveNodesChange(Collection<ClusterPartition> newPartitions) {
for (ClusterPartition newPart : newPartitions) {
for (ClusterPartition currentPart : getLastPartitions()) {
if (!newPart.getMasteraddress().equals(currentPart.getMasteraddress())) {
continue;
}
MasterSlaveEntry entry = getEntry(currentPart.getMasteraddr());
// should be invoked first in order to remove stale FailedSlaveAddresses
Set<URI> addedSlaves = addRemoveSlaves(entry,currentPart,newPart);
// Do some slaves have changed state from Failed to alive?
updownSlaves(entry,newPart,addedSlaves);
break;
}
}
}
@Test
public void testGetInfoServer() throws IOException,URISyntaxException {
HdfsConfiguration conf = new HdfsConfiguration();
URI httpsport = Dfsutil.getInfoServer(null,conf,"https");
assertEquals(new URI("https",null,"0.0.0.0",DFS_NAMENODE_HTTPS_PORT_DEFAULT,null),httpsport);
URI httpport = Dfsutil.getInfoServer(null,"http");
assertEquals(new URI("http",DFS_NAMENODE_HTTP_PORT_DEFAULT,httpport);
URI httpAddress = Dfsutil.getInfoServer(new InetSocketAddress(
"localhost",8020),"http");
assertEquals(
URI.create("http://localhost:" + DFS_NAMENODE_HTTP_PORT_DEFAULT),httpAddress);
}
项目:omero-ms-queue
文件:QueuedOmeroKeepAliveTest.java
@Test
public void enforceValueEquality() {
URI omero = URI.create("h:1");
String sessionKey = "sk";
FutureTimepoint Now = Now();
QueuedOmeroKeepAlive value =
new QueuedOmeroKeepAlive(omero,sessionKey,Now);
QueuedOmeroKeepAlive valuecopy =
new QueuedOmeroKeepAlive(omero,Now);
assertthat(value.getomero(),is(omero));
assertthat(value.getSessionKey(),is(sessionKey));
assertthat(value.getUntilWhen(),is(Now));
assertthat(value,is(valuecopy));
assertthat(value.hashCode(),is(valuecopy.hashCode()));
}
项目:neoscada
文件:VisualInterfaceViewer.java
private void applyImage ( final Symbol symbol,final SymbolLoader symbolLoader )
{
if ( symbol.getBackgroundImage () == null || symbol.getBackgroundImage ().isEmpty () )
{
return;
}
logInfo ( "Trying to load background image: " + symbol.getBackgroundImage () );
final String uriString = symbolLoader.resolveUri ( symbol.getBackgroundImage () );
final org.eclipse.emf.common.util.URI uri = org.eclipse.emf.common.util.URI.createURI ( uriString );
this.loadedResources.add ( uri );
try
{
final Image img = this.manager.createImageWithDefault ( ImageDescriptor.createFromURL ( new URL ( uriString ) ) );
this.canvas.setBackgroundImage ( img );
}
catch ( final MalformedURLException e )
{
logError ( "Loading background image: " + uriString,e ); //$NON-NLS-1$
}
}
public static RevocationStatus check(X509Certificate cert,X509Certificate issuerCert,URI responderURI,X509Certificate responderCert,Date date,List<Extension> extensions)
throws IOException,CertPathValidatorException
{
CertId certId = null;
try {
X509CertImpl certImpl = X509CertImpl.toImpl(cert);
certId = new CertId(issuerCert,certImpl.getSerialNumberObject());
} catch (CertificateException | IOException e) {
throw new CertPathValidatorException
("Exception while encoding OCSPRequest",e);
}
OCSPResponse ocspResponse = check(Collections.singletonList(certId),responderURI,issuerCert,responderCert,date,extensions);
return (RevocationStatus) ocspResponse.getSingleResponse(certId);
}
项目:incubator-netbeans
文件:LibrariesNode.java
private Key (
@NonNull final AntArtifact a,@NonNull final URI uri,@NonNull final String classpathId,@NonNull final String entryId,@NullAllowed final Consumer<Pair<String,String>> preRemoveAction,String>> postRemoveAction,boolean shared) {
this.type = TYPE_PROJECT;
this.antArtifact = a;
this.uri = uri;
this.classpathId = classpathId;
this.entryId = entryId;
this.preRemoveAction = preRemoveAction;
this.postRemoveAction = postRemoveAction;
this.shared = shared;
}
项目:mid-tier
文件:CustomerEventServiceExposureTest.java
@Test
public void testListEventsByCategory() throws URISyntaxException {
UriInfo ui = mock(UriInfo.class);
when(ui.getBaseUriBuilder()).then(new UriBuilderFactory(URI.create("http://mock")));
Request request = mock(Request.class);
when(archivist.getEventsForCategory(Event.getCategory("some","category"),Optional.empty()))
.thenReturn(Collections.singletonList(new Event(new URI("customer-events/some-category/eventSID"),"some-category",CurrentTime.Now())));
Response response = service.getCustomerEventsByCategory(ui,request,"application/hal+json","");
EventsRepresentation events = (EventsRepresentation) response.getEntity();
assertEquals(1,events.getEvents().size());
assertEquals("http://mock/customer-events",events.getSelf().getHref());
response = service.getCustomerEventsByCategory(ui,"application/hal+json;no-real-type","");
assertEquals(415,response.getStatus());
}
项目:openjdk-jdk10
文件:XDesktopPeer.java
private void launch(URI uri) throws IOException {
byte[] uriByteArray = ( uri.toString() + '\0' ).getBytes();
boolean result = false;
XToolkit.awtLock();
try {
if (!nativeLibraryLoaded) {
throw new IOException("Failed to load native libraries.");
}
result = gnome_url_show(uriByteArray);
} finally {
XToolkit.awtUnlock();
}
if (!result) {
throw new IOException("Failed to show URI:" + uri);
}
}
项目:elasticsearch_my
文件:RestClient.java
private static URI buildUri(String pathPrefix,String path,Map<String,String> params) {
Objects.requireNonNull(path,"path must not be null");
try {
String fullPath;
if (pathPrefix != null) {
if (path.startsWith("/")) {
fullPath = pathPrefix + path;
} else {
fullPath = pathPrefix + "/" + path;
}
} else {
fullPath = path;
}
URIBuilder uriBuilder = new URIBuilder(fullPath);
for (Map.Entry<String,String> param : params.entrySet()) {
uriBuilder.addParameter(param.getKey(),param.getValue());
}
return uriBuilder.build();
} catch(URISyntaxException e) {
throw new IllegalArgumentException(e.getMessage(),e);
}
}
项目:redirector
文件:RedirectorOfflineUI.java
@GET
@Produces(MediaType.TEXT_HTML)
public Response defaultPage(@Context UriInfo ui) throws URISyntaxException {
/*
* This redirect is required due to change of "Jersey" version from "1.17" to "2.13".
* The "1.*" version of jersey has property "FEATURE_REDIRECT".
* For example,when making request "localhost:8888/context/dev",Jersey checks whether "FEATURE_REDIRECT" is set to "true" in ServletContainer and request does not end with '/'.
* If so,trailing slash is added and redirect is occurred to "localhost:8888/context/dev/"
*
* Jersey "2.*" does not contain property "FEATURE_REDIRECT".
* The code that made redirect in "1.*" jersey is commented out in ServletContainer.java:504
* Jersey "2.*" resolves request even if '/' was not present in the end.
* But all links in our *.jsp and *.html to *.js and *.css are relative. So without adding '/' in the end,files can not be opened.
* To solve it,we introduced this redirect
*/
if (!ui.getAbsolutePath().toString().endsWith("/")) {
return Response.temporaryRedirect(new URI(ui.getAbsolutePath().toString() + "/")).build();
} else {
return Response.ok(new Viewable("/index.jsp",new HashMap<String,Object>())).build();
}
}
项目:verify-hub
文件:MatchingServiceHealthChecker.java
private MatchingServiceHealthCheckDetails generateHealthCheckFailureDescription(
final MatchingServiceHealthCheckResponseDto response,final URI matchingServiceUri,final boolean isOnboarding) {
if (!response.getResponse().isPresent()) {
return generateHealthCheckDescription("no response",matchingServiceUri,response.getVersionNumber(),isOnboarding);
}
return generateHealthCheckDescription("responded with non-healthy status",isOnboarding);
}
项目:rs-aggregator
文件:SyncJob.java
public void readListAndSynchronize() throws Exception {
List<URI> uriList = new ArrayList<>();
Scanner scanner = new Scanner(new File(getUriListLocation()));
while (scanner.hasNextLine()) {
String uriString = scanner.nextLine();
Optional<URI> maybeUri = normURI.normalize(uriString);
if (maybeUri.isPresent()) {
uriList.add(maybeUri.get());
} else {
logger.warn("Unable to convert {} to a URI",uriString);
}
}
synchronize(uriList);
}
项目:lams
文件:FileBackedHttpResource.java
/**
* Constructor.
*
* @param resource HTTP(S) URL of the resource
* @param backingFile file: URI location to store the resource
*
* @since 1.2
*/
public FileBackedHttpResource(String resource,URI backingFile) {
super(resource);
if (backingFile == null) {
throw new IllegalArgumentException("backing file path may not be null or empty");
}
resourceFile = new File(backingFile);
}
项目:hadoop
文件:TestMRCredentials.java
/**
* run a distributed job and verify that TokenCache is available
* @throws IOException
*/
@Test
public void test () throws IOException {
// make sure JT starts
Configuration jobConf = new JobConf(mrCluster.getConfig());
// provide namenodes names for the job to get the delegation tokens for
//String nnUri = dfsCluster.getNameNode().getUri(namenode).toString();
NameNode nn = dfsCluster.getNameNode();
URI nnUri = NameNode.getUri(nn.getNameNodeAddress());
jobConf.set(JobContext.JOB_NAMENODES,nnUri + "," + nnUri.toString());
jobConf.set("mapreduce.job.credentials.json","keys.json");
// using argument to pass the file name
String[] args = {
"-m","1","-r","-mt","-rt","1"
};
int res = -1;
try {
res = ToolRunner.run(jobConf,new CredentialsTestJob(),args);
} catch (Exception e) {
System.out.println("Job Failed with" + e.getLocalizedMessage());
e.printstacktrace(System.out);
fail("Job Failed");
}
assertEquals("dist job res is not 0",res,0);
}
@Test
public void testAdaptationSimple() throws ParseException {
FilterParser<URI> filterParser = new FilterParser<>(URI.class);
Filter<URI> filter = filterParser.parse("HostEquals(www.dsi.unimi.it) or " +
"it.unimi.di.law.warc.filters.FiltersTest$startsWithStringFilter(http://xx)");
System.out.println("TESTING: " + filter);
assertTrue(filter.apply(BURL.parse("http://www.dsi.unimi.it/mb")));
assertTrue(filter.apply(BURL.parse("http://xxx.foo.bar")));
assertFalse(filter.apply(BURL.parse("http://yyy.foo.bar")));
}
项目:GitHub
文件:responsecacheTest.java
/**
* Fail if a badly-behaved cache returns a null status line header.
* https://code.google.com/p/android/issues/detail?id=160522
*/
@Test public void responsecacheReturnsNullStatusLine() throws Exception {
String cachedContentString = "Hello";
final byte[] cachedContent = cachedContentString.getBytes(StandardCharsets.US_ASCII);
setInternalCache(new CacheAdapter(new Abstractresponsecache() {
@Override
public CacheResponse get(URI uri,String requestMethod,List<String>> requestHeaders)
throws IOException {
return new CacheResponse() {
@Override public Map<String,List<String>> getHeaders() throws IOException {
String contentType = "text/plain";
Map<String,List<String>> headers = new LinkedHashMap<>();
headers.put("Content-Length",Arrays.asList(Integer.toString(cachedContent.length)));
headers.put("Content-Type",Arrays.asList(contentType));
headers.put("Expires",Arrays.asList(formatDate(-1,TimeUnit.HOURS)));
headers.put("Cache-Control",Arrays.asList("max-age=60"));
// Crucially,the header with a null key is missing,which renders the cache response
// unusable because OkHttp only caches responses with cacheable response codes.
return headers;
}
@Override public InputStream getBody() throws IOException {
return new ByteArrayInputStream(cachedContent);
}
};
}
}));
HttpURLConnection connection = openConnection(server.url("/").url());
// If there was no status line from the cache an exception will be thrown. No network request
// should be made.
try {
connection.getResponseCode();
fail();
} catch (ProtocolException expected) {
}
}
项目:incubator-netbeans
文件:StandardProjectSettings.java
@Override
public Preferences getProjectSettings(String mimeType) {
if (hasLocation()) {
URI settingsLocation = project.getProjectDirectory().toURI().resolve(encodeSettingsFileLocation(getSettingsFileLocation()));
return ToolPreferences.from(settingsLocation).getPreferences(HINTS_TOOL_ID,mimeType);
} else {
return ProjectUtils.getPreferences(project,ProjectSettings.class,true).node(mimeType);
}
}
项目:athena
文件:GrpcRemoteServiceProvider.java
private ManagedChannel createChannel(URI uri) {
log.debug("Creating channel for {}",uri);
int port = GrpcRemoteServiceServer.DEFAULT_LISTEN_PORT;
if (uri.getPort() != -1) {
port = uri.getPort();
}
return NettyChannelBuilder.forAddress(uri.getHost(),port)
.negotiationType(NegotiationType.PLAINTEXT)
.build();
}
项目:verify-hub
文件:MatchingServiceRequestGeneratorResourceTest.java
private Response getAttributeQuery(AttributeQueryRequestDto dto) {
final URI uri = samlEngineAppRule.getUri(Urls.SamlEngineUrls.GENERATE_ATTRIBUTE_QUERY_RESOURCE);
return client.target(uri)
.request()
.post(Entity.json(dto),Response.class);
}
项目:incubator-netbeans
文件:LibrariesSupport.java
/**
* Returns a URI representing the root of an archive.
* @param uri of a ZIP- (or JAR-) format archive file; can be relative
* @return the <code>jar</code>-protocol URI of the root of the archive
* @since org.netbeans.modules.project.libraries/1 1.18
*/
public static URI getArchiveRoot(URI uri) {
assert !uri.toString().contains("!/") : uri;
try {
return new URI((uri.isAbsolute() ? "jar:" : "") + uri.toString() + "!/"); // NOI18N
} catch (URISyntaxException ex) {
throw new AssertionError(ex);
}
}
项目:joal
文件:TrackerClientProvider.java
public TrackerClientProvider(final TorrentWithStats torrent,final ConnectionHandler connectionHandler,final BitTorrentClient bitTorrentClient) {
this.torrent = torrent;
this.connectionHandler = connectionHandler;
this.bitTorrentClient = bitTorrentClient;
final Set<URI> addresses = torrent.getTorrent().getAnnounceList().stream()
.unordered()
.flatMap(Collection::stream)
.collect(Collectors.toSet());
this.addressIterator = Iterators.cycle(addresses);
this.addressesCount = addresses.size();
}
项目:keti
文件:MonitoringHttpMethodsFilterTest.java
@Test(dataProvider = "urisAndTheirAllowedHttpMethods")
public void testUriPatternsAndTheirAllowedHttpMethods(final String uri,final Set<HttpMethod> allowedHttpMethods)
throws Exception {
Set<HttpMethod> disallowedHttpMethods = new HashSet<>(ALL_HTTP_METHODS);
disallowedHttpMethods.removeAll(allowedHttpMethods);
for (HttpMethod disallowedHttpMethod : disallowedHttpMethods) {
this.mockmvc.perform(mockmvcRequestBuilders.request(disallowedHttpMethod,URI.create(uri)))
.andExpect(mockmvcResultMatchers.status().isMethodNotAllowed());
}
}
项目:verify-hub
文件:SamlMessageSenderApiResourceTest.java
@Test
public void sendSignedJsonAuthnResponseFromHub_shouldRespondWithNextLocation() throws Exception {
SessionId sessionId = SessionId.createNewSessionId();
URI nextLocationUri = URI.create("http://blah");
String requestId = UUID.randomUUID().toString();
ResponseAssertionSigner responseAssertionSigner = new ResponseAssertionSigner(
new SignatureFactory(new IdaKeyStoreCredentialRetriever(getKeyStore()),SIGNATURE_ALGORITHM,DIGEST_ALGORITHM)
);
Function<OutboundResponseFromHub,String> outboundResponseFromHubToStringTransformer = new HubTransformersFactory()
.getoutboundResponseFromHubToStringTransformer(
new HardCodedKeyStore(HUB_ENTITY_ID),getKeyStore(),new IdpHardCodedEntityToEncryptForLocator(),responseAssertionSigner,DIGEST_ALGORITHM
);
OutboundResponseFromHub authnResponseFromHub = anAuthnResponse()
.withInResponseto(requestId)
.withIssuerId(HUB_ENTITY_ID)
.withTransactionIdaStatus(TransactionIdaStatus.Success)
.buildOutboundResponseFromHub();
String samlString = outboundResponseFromHubToStringTransformer.apply(authnResponseFromHub);
AuthnResponseFromHubContainerDto authnResponseFromHubContainerDto = new AuthnResponseFromHubContainerDto(
samlString,nextLocationUri,com.google.common.base.Optional.absent(),authnResponseFromHub.getId());
policyStubRule.anAuthnResponseFromHubToRp(sessionId,authnResponseFromHubContainerDto);
javax.ws.rs.core.Response response = getResponseFromSamlProxy(Urls.SamlProxyUrls.SEND_RESPONSE_FROM_HUB_API_RESOURCE,sessionId);
assertthat(response.readEntity(SamlMessageSenderHandler.SamlMessage.class).getPostEndpoint()).isEqualTo(nextLocationUri.toASCIIString());
}
项目:monarch
文件:TierStoreORCWriter.java
@Override
public void _openChunkWriter(final Properties props,URI baseURI,String[] tablePathParts,Configuration conf) throws IOException {
CompressionKind compression = getCompressionKind(props);
int bufferSize = getBufferSize(props);
int stripeSize = getStripeSize(props);
int newIndexStride = getNewIndexStride(props);
this.chunkWriter = createWriter(Paths.get(baseURI.getPath(),tablePathParts),compression,bufferSize,stripeSize,newIndexStride,WriteAheadLog.WAL_FILE_RECORD_LIMIT);
}
项目:OCast-Java
文件:LinkProfile.java
/**
* Returns the hostname
* @return
*/
public String getHostname() {
if(hostname == null && app2AppUrl != null) {
return URI.create(app2AppUrl).getHost();
} else {
return hostname;
}
}
项目:shibboleth-idp-oidc-extension
文件:SectorIdentifierLookupFunctionTest.java
@SuppressWarnings("unchecked")
@BeforeMethod
protected void setUp() throws Exception {
sector = new URI("https://example.org/uri");
lookup = new SectorIdentifierLookupFunction();
final RequestContext requestCtx = new RequestContextBuilder().buildrequestContext();
prc = new WebflowRequestContextProfileRequestContextLookup().apply(requestCtx);
msgCtx = new MessageContext<AuthenticationRequest>();
prc.setInboundMessageContext(msgCtx);
ctx = new OIDCMetadataContext();
OIDcclientMetadata Metadata= new OIDcclientMetadata();
OIDcclient@R_495_4045@ion @R_495_4045@ion = new OIDcclient@R_495_4045@ion(new ClientID(),new Date(),Metadata,new Secret() );
ctx.setClient@R_495_4045@ion(@R_495_4045@ion);
msgCtx.addSubcontext(ctx);
}
项目:vrap
文件:WebJarHandler.java
项目:educational-plugin
文件:EduStepicConnector.java
public static StepicWrappers.CoursesContainer getCoursesFromStepik(@Nullable StepicUser user,URI url) throws IOException {
final StepicWrappers.CoursesContainer coursesContainer;
if (user != null) {
coursesContainer = EduStepicAuthorizedClient.getFromStepic(url.toString(),StepicWrappers.CoursesContainer.class,user);
}
else {
coursesContainer = EduStepicclient.getFromStepic(url.toString(),StepicWrappers.CoursesContainer.class);
}
return coursesContainer;
}
项目:incubator-netbeans
文件:WSDLSemanticValidatorTest.java
public void testValidateSolicitResponSEOperationFaultInvalidMessage() throws Exception {
String fileName = "/org/netbeans/modules/xml/wsdl/validator/resources/ptTests/opTests/solrep/faultBogusMsg_error.wsdl";
URL url = getClass().getResource(fileName);
URI uri = url.toURI();
HashSet<String> expectedErrors = new HashSet<String>();
expectedErrors.add(format(mMessages.getString("VAL_MESSAGE_NOT_FOUND_IN_OPERATION_FAULT")));
validate(uri,expectedErrors);
}
项目:lams
文件:SpdyClientProvider.java
private ChannelListener<StreamConnection> createOpenListener(final ClientCallback<ClientConnection> listener,final URI uri,final XnioSsl ssl,final Pool<ByteBuffer> bufferPool,final OptionMap options) {
return new ChannelListener<StreamConnection>() {
@Override
public void handleEvent(StreamConnection connection) {
handleConnected(connection,listener,uri,ssl,bufferPool,options);
}
};
}
public ActionType(final URI about)
throws URISyntaxException
{
super(about);
// Start of user code constructor2
// End of user code
}
项目:AthenaX
文件:AthenaXServer.java
private void start(AthenaXConfiguration conf) throws Exception {
ServerContext.INSTANCE.initialize(conf);
ServerContext.INSTANCE.start();
try (WebServer server = new WebServer(URI.create(conf.masterUri()))) {
server.start();
Thread.currentThread().join();
}
}
项目:asura
文件:TokenSmsSender.java
/**
* post 参数
*
* @param smsMessage
*/
@Override
protected HttpPost buildPostParam(SmsMessage smsMessage) throws UnsupportedEncodingException,URISyntaxException {
URI uri = super.buildURIByConfig();
HttpPost httpPost = new HttpPost(uri);
TokenSmsSenderConfig config = (TokenSmsSenderConfig) getConfig();
HashMap<String,String> map = new HashMap<>();
map.put("token",config.getToken());
map.put("to",smsMessage.getToPhone());
map.put("content",smsMessage.getContent());
StringEntity entity = new StringEntity(JsonEntityTransform.Object2Json(map),config.getCharset());
httpPost.setEntity(entity);
return httpPost;
}
项目:lams
文件:SpdyClientProvider.java
@Override
public void connect(final ClientCallback<ClientConnection> listener,InetSocketAddress bindAddress,final XnioIoThread ioThread,final OptionMap options) {
if(uri.getScheme().equals("spdy-plain")) {
if(bindAddress == null) {
ioThread.openStreamConnection(new InetSocketAddress(uri.getHost(),uri.getPort() == -1 ? 443 : uri.getPort()),createOpenListener(listener,options),options).addNotifier(createNotifier(listener),null);
} else {
ioThread.openStreamConnection(bindAddress,new InetSocketAddress(uri.getHost(),null);
}
return;
}
if(ALPN_PUT_METHOD == null) {
listener.Failed(UndertowMessages.MESSAGES.jettyNPNNotAvailable());
return;
}
if (ssl == null) {
listener.Failed(UndertowMessages.MESSAGES.sslWasNull());
return;
}
if(bindAddress == null) {
ssl.openSslConnection(ioThread,null);
} else {
ssl.openSslConnection(ioThread,bindAddress,null);
}
}
项目:spring-webflux-client
文件:DefaultReactiveInvocationHandlerFactory.java
@Override
public InvocationHandler build(ExtendedClientCodecConfigurer codecConfigurer,List<RequestProcessor> requestProcessors,List<ResponseProcessor> responseProcessors,Logger logger,LogLevel logLevel,Class<?> target,URI uri) {
ExchangeFilterFunction exchangeFilterFunction = exchangeFilterFunctionFactory.build(requestProcessors,responseProcessors,logger,logLevel);
RequestExecutor requestExecutor = requestExecutorFactory.build(codecConfigurer,exchangeFilterFunction);
ResponseBodyProcessor responseBodyProcessor = new DefaultResponseBodyProcessor(codecConfigurer.getErrorReaders());
Map<Method,ClientMethodHandler> invocationdispatcher = methodMetadataFactory.build(target,uri)
.stream()
.collect(toMap(MethodMetadata::getTargetmethod,methodMetadata -> new DefaultClientMethodHandler(methodMetadata,requestExecutor,responseBodyProcessor)));
return new DefaultReactiveInvocationHandler(invocationdispatcher);
}
项目:scanning
文件:ConsumerView.java
@Override
public void createPartControl(Composite content) {
content.setLayout(new GridLayout(1,false));
Util.removeMargins(content);
this.viewer = new TableViewer(content,SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
viewer.setUseHashlookup(true);
viewer.getTable().setHeaderVisible(true);
viewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
createColumns();
viewer.setContentProvider(createContentProvider());
consumers = new ConcurrentHashMap<>();
viewer.setInput(consumers);
createActions();
try {
createtopicListener(new URI(Activator.getJmsUri()));
} catch (Exception e) {
logger.error("Cannot listen to topic of command server!",e);
}
final String partName = getSecondaryIdAttribute("partName");
if (partName!=null) setPartName(partName);
}
项目:minijax
文件:HttpHeadersTest.java
@Test
public void testLanguageMissing() {
final MultivaluedMap<String,String> headers = new MultivaluedHashMap<>();
final MockHttpServletRequest request = new MockHttpServletRequest("GET",URI.create("/"),headers,null);
final MinijaxHttpHeaders httpHeaders = new MinijaxHttpHeaders(request);
assertNull(httpHeaders.getLanguage());
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。