Examples of URLConnectionFactory


Examples of org.apache.hadoop.hdfs.web.URLConnectionFactory

      printUsage(System.err);
    }
    // default to using the local file system
    FileSystem local = FileSystem.getLocal(conf);
    final Path tokenFile = new Path(local.getWorkingDirectory(), remaining[0]);
    final URLConnectionFactory connectionFactory = URLConnectionFactory.DEFAULT_SYSTEM_CONNECTION_FACTORY;

    // Login the current user
    UserGroupInformation.getCurrentUser().doAs(
        new PrivilegedExceptionAction<Object>() {
          @Override
View Full Code Here

Examples of org.apache.hadoop.hdfs.web.URLConnectionFactory

    HttpURLConnection conn = mock(HttpURLConnection.class);
    doReturn(new ByteArrayInputStream(FAKE_LOG_DATA)).when(conn).getInputStream();
    doReturn(HttpURLConnection.HTTP_OK).when(conn).getResponseCode();
    doReturn(Integer.toString(FAKE_LOG_DATA.length)).when(conn).getHeaderField("Content-Length");

    URLConnectionFactory factory = mock(URLConnectionFactory.class);
    doReturn(conn).when(factory).openConnection(Mockito.<URL> any(),
        anyBoolean());

    URL url = new URL("http://localhost/fakeLog");
    EditLogInputStream elis = EditLogFileInputStream.fromUrl(factory, url,
View Full Code Here

Examples of org.apache.hadoop.hdfs.web.URLConnectionFactory

      printUsage(System.err);
    }
    // default to using the local file system
    FileSystem local = FileSystem.getLocal(conf);
    final Path tokenFile = new Path(local.getWorkingDirectory(), remaining[0]);
    final URLConnectionFactory connectionFactory = URLConnectionFactory.DEFAULT_SYSTEM_CONNECTION_FACTORY;

    // Login the current user
    UserGroupInformation.getCurrentUser().doAs(
        new PrivilegedExceptionAction<Object>() {
          @Override
View Full Code Here

Examples of org.springsource.ide.eclipse.commons.frameworks.core.downloadmanager.URLConnectionFactory

  private final URLConnectionFactory urlConnectionFactory;
  private final String JSON_URL;
  private final String CONTENT_TYPE;

  public NewSpringBootWizardModel() throws Exception {
    this(new URLConnectionFactory(), StsProperties.getInstance(new NullProgressMonitor()));
  }
View Full Code Here

Examples of org.springsource.ide.eclipse.commons.frameworks.core.downloadmanager.URLConnectionFactory

    super.setUp();
  }
 
  public static NewSpringBootWizardModel parseFrom(String resourcePath) throws Exception {
    URL formUrl = resourceUrl(resourcePath);
    return new NewSpringBootWizardModel(new URLConnectionFactory(), formUrl.toString(), "application/json");
  }
View Full Code Here

Examples of org.springsource.ide.eclipse.commons.frameworks.core.downloadmanager.URLConnectionFactory

    doParseTest("initializr-variant.json"); //same file with some extra 'crap' added which parser should tolerate.
  }

  private void doParseTest(String resource) throws IOException, Exception {
    URL url = NewSpringBootWizardModelTest.class.getResource(resource);
    URLConnection conn = new URLConnectionFactory().createConnection(url);
    conn.connect();
    InputStream input = conn.getInputStream();
    try {
      InitializrServiceSpec spec = InitializrServiceSpec.parseFrom(input);
      assertNotNull(spec);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.