Tabnine Logo
UrlProcessorRelativeToAbsolute.process
Code IndexAdd Tabnine to your IDE (free)

How to use
process
method
in
ru.noties.markwon.UrlProcessorRelativeToAbsolute

Best Java code snippets using ru.noties.markwon.UrlProcessorRelativeToAbsolute.process (Showing top 8 results out of 315)

origin: noties/Markwon

  @NonNull
  @Override
  public String process(@NonNull String destination) {
    String out;
    final Uri uri = Uri.parse(destination);
    if (TextUtils.isEmpty(uri.getScheme())) {
      out = processor.process(destination);
    } else {
      out = destination;
    }
    return out;
  }
}
origin: noties/Markwon

  @NonNull
  @Override
  public String process(@NonNull String destination) {
    final String out;
    final Uri uri = Uri.parse(destination);
    if (TextUtils.isEmpty(uri.getScheme())) {
      out = assetsProcessor.process(destination).replace(MOCK, BASE);
    } else {
      if (processor != null) {
        out = processor.process(destination);
      } else {
        out = destination;
      }
    }
    return out;
  }
}
origin: noties/Markwon

@Test
public void malformed_base_do_not_process() {
  final UrlProcessorRelativeToAbsolute processor = new UrlProcessorRelativeToAbsolute("!@#$%^&*(");
  final String destination = "../hey.there.html";
  assertEquals(destination, processor.process(destination));
}
origin: noties/Markwon

  @Test
  public void with_query_arguments() {
    final UrlProcessorRelativeToAbsolute processor = new UrlProcessorRelativeToAbsolute("http://ro.ot/first/");
    final String url = "../index.php?ROOT=1";
    assertEquals(
        "http://ro.ot/index.php?ROOT=1",
        processor.process(url)
    );
  }
}
origin: noties/Markwon

@Test
public void access_same_directory() {
  final UrlProcessorRelativeToAbsolute processor = new UrlProcessorRelativeToAbsolute("https://ro.ot/hello/");
  final String url = "./.htaccess";
  assertEquals("https://ro.ot/hello/.htaccess", processor.process(url));
}
origin: noties/Markwon

@Test
public void asset_directory_up() {
  final UrlProcessorRelativeToAbsolute processor = new UrlProcessorRelativeToAbsolute("http://ro.ot/first/second/");
  final String url = "../cat.JPG";
  assertEquals("http://ro.ot/first/cat.JPG", processor.process(url));
}
origin: noties/Markwon

@Test
public void access_root() {
  final UrlProcessorRelativeToAbsolute processor = new UrlProcessorRelativeToAbsolute("https://ro.ot/hello/");
  final String url = "/index.html";
  assertEquals("https://ro.ot/index.html", processor.process(url));
}
origin: noties/Markwon

@Test
public void change_directory_inside_destination() {
  final UrlProcessorRelativeToAbsolute processor = new UrlProcessorRelativeToAbsolute("http://ro.ot/first/");
  final String url = "../first/../second/./thi.rd";
  assertEquals(
      "http://ro.ot/second/thi.rd",
      processor.process(url)
  );
}
ru.noties.markwonUrlProcessorRelativeToAbsoluteprocess

Popular methods of UrlProcessorRelativeToAbsolute

  • <init>
  • obtain

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JFileChooser (javax.swing)
  • Best plugins for Eclipse
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