Tabnine Logo
WebServer.getFile
Code IndexAdd Tabnine to your IDE (free)

How to use
getFile
method
in
org.h2.server.web.WebServer

Best Java code snippets using org.h2.server.web.WebServer.getFile (Showing top 17 results out of 315)

origin: com.h2database/h2

/**
 * Read the translation for this language and save them in the 'text'
 * property of this session.
 *
 * @param session the session
 * @param language the language
 */
void readTranslations(WebSession session, String language) {
  Properties text = new Properties();
  try {
    trace("translation: "+language);
    byte[] trans = getFile("_text_"+language+".prop");
    trace("  "+new String(trans));
    text = SortedProperties.fromLines(new String(trans, StandardCharsets.UTF_8));
    // remove starting # (if not translated yet)
    for (Entry<Object, Object> entry : text.entrySet()) {
      String value = (String) entry.getValue();
      if (value.startsWith("#")) {
        entry.setValue(value.substring(1));
      }
    }
  } catch (IOException e) {
    DbException.traceThrowable(e);
  }
  session.put("text", new HashMap<>(text));
}
origin: com.h2database/h2

  return;
byte[] bytes = server.getFile(file);
if (bytes == null) {
  resp.sendError(HttpServletResponse.SC_NOT_FOUND);
origin: com.h2database/h2

  message = "HTTP/1.1 304 Not Modified\r\n";
} else {
  bytes = server.getFile(file);
  if (bytes == null) {
    message = "HTTP/1.1 404 Not Found\r\n";
origin: com.h2database/h2

String page = new String(server.getFile("result.jsp"), StandardCharsets.UTF_8);
int idx = page.indexOf("${result}");
origin: com.h2database/com.springsource.org.h2

String getTextFile(String file) throws IOException {
  byte[] bytes = getFile(file);
  return new String(bytes);
}
origin: com.h2database/com.springsource.org.h2

public void readTranslations(WebSession session, String language) {
  Properties text = new Properties();
  try {
    trace("translation: "+language);
    byte[] trans = getFile("_text_"+language+".properties");
    trace("  "+new String(trans));
    text.load(new ByteArrayInputStream(trans));
    // remove starting # (if not translated yet)
    for (Iterator it = text.entrySet().iterator(); it.hasNext();) {
      Entry entry = (Entry) it.next();
      String value = (String) entry.getValue();
      if (value.startsWith("#")) {
        entry.setValue(value.substring(1));
      }
    }
  } catch (IOException e) {
    TraceSystem.traceThrowable(e);
  }
  session.put("text", new HashMap(text));
}
origin: com.eventsourcing/h2

/**
 * Read the translation for this language and save them in the 'text'
 * property of this session.
 *
 * @param session the session
 * @param language the language
 */
void readTranslations(WebSession session, String language) {
  Properties text = new Properties();
  try {
    trace("translation: "+language);
    byte[] trans = getFile("_text_"+language+".prop");
    trace("  "+new String(trans));
    text = SortedProperties.fromLines(new String(trans, Constants.UTF8));
    // remove starting # (if not translated yet)
    for (Entry<Object, Object> entry : text.entrySet()) {
      String value = (String) entry.getValue();
      if (value.startsWith("#")) {
        entry.setValue(value.substring(1));
      }
    }
  } catch (IOException e) {
    DbException.traceThrowable(e);
  }
  session.put("text", new HashMap<Object, Object>(text));
}
origin: org.wowtools/h2

/**
 * Read the translation for this language and save them in the 'text'
 * property of this session.
 *
 * @param session the session
 * @param language the language
 */
void readTranslations(WebSession session, String language) {
  Properties text = new Properties();
  try {
    trace("translation: "+language);
    byte[] trans = getFile("_text_"+language+".prop");
    trace("  "+new String(trans));
    text = SortedProperties.fromLines(new String(trans, Constants.UTF8));
    // remove starting # (if not translated yet)
    for (Entry<Object, Object> entry : text.entrySet()) {
      String value = (String) entry.getValue();
      if (value.startsWith("#")) {
        entry.setValue(value.substring(1));
      }
    }
  } catch (IOException e) {
    DbException.traceThrowable(e);
  }
  session.put("text", new HashMap<Object, Object>(text));
}
origin: com.eventsourcing/h2

  return;
byte[] bytes = server.getFile(file);
if (bytes == null) {
  resp.sendError(HttpServletResponse.SC_NOT_FOUND);
origin: org.wowtools/h2

  return;
byte[] bytes = server.getFile(file);
if (bytes == null) {
  resp.sendError(HttpServletResponse.SC_NOT_FOUND);
origin: com.h2database/com.springsource.org.h2

  return;
} else {
  bytes = server.getFile(file);
origin: org.wowtools/h2

  message = "HTTP/1.1 304 Not Modified\r\n";
} else {
  bytes = server.getFile(file);
  if (bytes == null) {
    message = "HTTP/1.1 404 Not Found\r\n";
origin: com.eventsourcing/h2

  message = "HTTP/1.1 304 Not Modified\r\n";
} else {
  bytes = server.getFile(file);
  if (bytes == null) {
    message = "HTTP/1.1 404 Not Found\r\n";
origin: com.eventsourcing/h2

String page = new String(server.getFile("result.jsp"), Constants.UTF8);
int idx = page.indexOf("${result}");
origin: org.leapframework/jmms-engine

  return;
byte[] bytes = server.getFile(file);
if (bytes == null) {
  resp.sendError(HttpServletResponse.SC_NOT_FOUND);
origin: org.wowtools/h2

String page = new String(server.getFile("result.jsp"), Constants.UTF8);
int idx = page.indexOf("${result}");
origin: com.h2database/com.springsource.org.h2

  message = "HTTP/1.1 304 Not Modified\n";
} else {
  bytes = server.getFile(file);
  if (bytes == null) {
    message = "HTTP/1.0 404 Not Found\n";
org.h2.server.webWebServergetFile

Javadoc

Read the given file from the file system or from the resources.

Popular methods of WebServer

  • <init>
  • getSession
    Get the web session object for the given session id.
  • init
  • addSession
    Create a session with a given connection.
  • getAllowOthers
  • getStartDateTime
  • setAllowChunked
  • setAllowOthers
  • createNewSession
    Create a new web session id and object.
  • generateSessionId
  • getConnection
  • getPort
  • getConnection,
  • getPort,
  • getSSL,
  • getSessions,
  • getSetting,
  • getSettingNames,
  • getSettings,
  • loadProperties,
  • readTranslations

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Top plugins for WebStorm
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