Tabnine Logo
JspHelper.getUrlParam
Code IndexAdd Tabnine to your IDE (free)

How to use
getUrlParam
method
in
org.apache.hadoop.hdfs.server.common.JspHelper

Best Java code snippets using org.apache.hadoop.hdfs.server.common.JspHelper.getUrlParam (Showing top 9 results out of 315)

origin: io.prestosql.hadoop/hadoop-apache

 /**
  * Returns the url parameter for the given string, prefixed with '&'.
  * 
  * @param name parameter name
  * @param val parameter value
  * @return url parameter
  */
 public static String getUrlParam(String name, String val) {
  return getUrlParam(name, val, false);
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Returns the url parameter for the given string, prefixed with '?' if
 * firstParam is true, prefixed with '&' if firstParam is false.
 * 
 * @param name parameter name
 * @param val parameter value
 * @param firstParam true if this is the first parameter in the list, false otherwise
 * @return url parameter
 */
public static String getUrlParam(String name, String val, boolean firstParam) {
 return getUrlParam(name, val, firstParam ? "?" : "&");
}

origin: ch.cern.hadoop/hadoop-hdfs

 /**
  * Returns the url parameter for the given string, prefixed with '&'.
  * 
  * @param name parameter name
  * @param val parameter value
  * @return url parameter
  */
 public static String getUrlParam(String name, String val) {
  return getUrlParam(name, val, false);
 }
}
origin: io.prestosql.hadoop/hadoop-apache

/**
 * Returns the url parameter for the given string, prefixed with '?' if
 * firstParam is true, prefixed with '&' if firstParam is false.
 * 
 * @param name parameter name
 * @param val parameter value
 * @param firstParam true if this is the first parameter in the list, false otherwise
 * @return url parameter
 */
public static String getUrlParam(String name, String val, boolean firstParam) {
 return getUrlParam(name, val, firstParam ? "?" : "&");
}

origin: org.apache.hadoop/hadoop-hdfs-test

private static void testViewingFile(MiniDFSCluster cluster, String filePath,
  boolean doTail) throws IOException {
 FileSystem fs = cluster.getFileSystem();
 Path testPath = new Path(filePath);
 if (!fs.exists(testPath)) {
  DFSTestUtil.writeFile(fs, testPath, FILE_DATA);
 }
 InetSocketAddress nnHttpAddress = cluster.getNameNode().getHttpAddress();
 int dnInfoPort = cluster.getDataNodes().get(0).getInfoPort();
 String jspName = doTail ? "tail.jsp" : "browseDirectory.jsp";
 String fileParamName = doTail ? "filename" : "dir";
 URL url = new URL("http://localhost:" + dnInfoPort + "/" + jspName +
   JspHelper.getUrlParam(fileParamName, URLEncoder.encode(testPath.toString(), "UTF-8"), true) +
   JspHelper.getUrlParam("namenodeInfoPort", Integer.toString(nnHttpAddress.getPort())));
 String viewFilePage = DFSTestUtil.urlGet(url);
 assertTrue("page should show preview of file contents", viewFilePage.contains(FILE_DATA));
 if (!doTail) {
  assertTrue("page should show link to download file", viewFilePage
    .contains("/streamFile" + URIUtil.encodePath(testPath.toString())));
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Create a redirection URL */
private URL createRedirectURL(UserGroupInformation ugi, DatanodeID host,
  HttpServletRequest request, NameNode nn) 
  throws IOException {
 final String hostname = host instanceof DatanodeInfo 
   ? host.getHostName() : host.getIpAddr();
 final String scheme = request.getScheme();
 int port = host.getInfoPort();
 if ("https".equals(scheme)) {
  final Integer portObject = (Integer) getServletContext().getAttribute(
    DFSConfigKeys.DFS_DATANODE_HTTPS_PORT_KEY);
  if (portObject != null) {
   port = portObject;
  }
 }
 final String encodedPath = ServletUtil.getRawPath(request, "/fileChecksum");
 String dtParam = "";
 if (UserGroupInformation.isSecurityEnabled()) {
  String tokenString = ugi.getTokens().iterator().next().encodeToUrlString();
  dtParam = JspHelper.getDelegationTokenUrlParam(tokenString);
 }
 String addr = nn.getNameNodeAddressHostPortString();
 String addrParam = JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, addr);
 return new URL(scheme, hostname, port, 
   "/getFileChecksum" + encodedPath + '?' +
   "ugi=" + ServletUtil.encodeQueryValue(ugi.getShortUserName()) + 
   dtParam + addrParam);
}
origin: io.prestosql.hadoop/hadoop-apache

/** Create a redirection URL */
private URL createRedirectURL(UserGroupInformation ugi, DatanodeID host,
  HttpServletRequest request, NameNode nn) 
  throws IOException {
 final String hostname = host instanceof DatanodeInfo 
   ? host.getHostName() : host.getIpAddr();
 final String scheme = request.getScheme();
 int port = host.getInfoPort();
 if ("https".equals(scheme)) {
  final Integer portObject = (Integer) getServletContext().getAttribute(
    DFSConfigKeys.DFS_DATANODE_HTTPS_PORT_KEY);
  if (portObject != null) {
   port = portObject;
  }
 }
 final String encodedPath = ServletUtil.getRawPath(request, "/fileChecksum");
 String dtParam = "";
 if (UserGroupInformation.isSecurityEnabled()) {
  String tokenString = ugi.getTokens().iterator().next().encodeToUrlString();
  dtParam = JspHelper.getDelegationTokenUrlParam(tokenString);
 }
 String addr = nn.getNameNodeAddressHostPortString();
 String addrParam = JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, addr);
 return new URL(scheme, hostname, port, 
   "/getFileChecksum" + encodedPath + '?' +
   "ugi=" + ServletUtil.encodeQueryValue(ugi.getShortUserName()) + 
   dtParam + addrParam);
}
origin: ch.cern.hadoop/hadoop-hdfs

  getServletContext());
String addr = nn.getNameNodeAddressHostPortString();
String addrParam = JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, addr);
origin: io.prestosql.hadoop/hadoop-apache

  getServletContext());
String addr = nn.getNameNodeAddressHostPortString();
String addrParam = JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, addr);
org.apache.hadoop.hdfs.server.commonJspHelpergetUrlParam

Javadoc

Returns the url parameter for the given string, prefixed with '&'.

Popular methods of JspHelper

  • getUGI
    Same as getUGI(null, request, conf).
  • getRemoteAddr
  • checkUsername
    Expected user name should be a short name.
  • getDefaultWebUserName
  • getDelegationTokenUrlParam
    Returns the url parameter for the given token string.
  • getNNServiceAddress
  • getTokenUGI
  • getUsernameFromQuery
  • bestNode
  • validatePath
    Validate filename.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • getExternalFilesDir (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JButton (javax.swing)
  • JTable (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now