Codota Logo
ResponseBuilder.fromFile
Code IndexAdd Codota to your IDE (free)

How to use
fromFile
method
in
it.tidalwave.northernwind.core.model.spi.ResponseBuilder

Best Java code snippets using it.tidalwave.northernwind.core.model.spi.ResponseBuilder.fromFile (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_properly_output_a_ResourceFile()
 throws Exception
 {
  final ResponseBuilder<?> builder = underTest.response().fromFile(resourceFile);
  assertContents(builder, "ResourceFileOutput.txt");
 }

origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_output_a_ResourceFile_when_Etag_not_Matching()
 throws Exception
 {
  headers.put(HEADER_IF_NONE_MATCH, "\"xxxx\"");
  final ResponseBuilder<?> builder = underTest.response().fromFile(resourceFile)
                             .forRequest(request);
  assertContents(builder, "ResourceFileOutput.txt");
 }

origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_output_NotModified_when_Etag_Matching()
 throws Exception
 {
  headers.put(HEADER_IF_NONE_MATCH, "\"1341242553456\"");
  final ResponseBuilder<?> builder = underTest.response().fromFile(resourceFile)
                             .forRequest(request);
  assertContents(builder, "ResourceFileNotModifiedOutput.txt");
 }

origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_properly_output_a_ResourceFile_with_ExpirationTime()
 throws Exception
 {
  final ResponseBuilder<?> builder = underTest.response().fromFile(resourceFile)
                             .withExpirationTime(Duration.standardDays(7));
  assertContents(builder, "ResourceFileOutputWithExpirationTime.txt");
 }

origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_output_a_ResourceFile_when_IfModifiedSince_less_recent_than_ModifiedTime()
 throws Exception
 {
  for (int deltaSeconds = -10; deltaSeconds < 0; deltaSeconds++)
   {
    final DateTime ifModifiedSinceTime = resourceLatestModifiedTime.plusSeconds(deltaSeconds);
    headers.put(HEADER_IF_MODIFIED_SINCE, toString(ifModifiedSinceTime));
    final ResponseBuilder<?> builder = underTest.response().fromFile(resourceFile)
                               .forRequest(request);
    assertContents(builder, "ResourceFileOutput.txt");
   }
 }

origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_output_NotModified_when_IfModifiedSince_more_recent_than_or_equal_to_ModifiedTime()
 throws Exception
 {
  // corner case: same time should return NotModified
  for (int deltaSeconds = 0; deltaSeconds < 10; deltaSeconds++)
   {
    final DateTime ifModifiedSinceTime = resourceLatestModifiedTime.plusSeconds(deltaSeconds);
    headers.put(HEADER_IF_MODIFIED_SINCE, toString(ifModifiedSinceTime));
    final ResponseBuilder<?> builder = underTest.response().fromFile(resourceFile)
                               .forRequest(request);
    assertContents(builder, "ResourceFileNotModifiedOutput.txt");
   }
 }

origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core-default

log.info(">>>> serving contents of {} ...", file.getPath().asString());
responseHolder.response().fromFile(file)
             .withExpirationTime(duration)
             .forRequest(request)
it.tidalwave.northernwind.core.model.spiResponseBuilderfromFile

Popular methods of ResponseBuilder

  • build
  • forException
  • forRequest
  • permanentRedirect
  • withExpirationTime
  • put
  • withBody
  • withContentType
  • withLatestModifiedTime
  • withStatus

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • putExtra (Intent)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JFileChooser (javax.swing)
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now