Tabnine Logo
File.getAbsoluteName
Code IndexAdd Tabnine to your IDE (free)

How to use
getAbsoluteName
method
in
java.io.File

Best Java code snippets using java.io.File.getAbsoluteName (Showing top 14 results out of 315)

origin: robovm/robovm

/**
 * Returns a Uniform Resource Identifier for this file. The URI is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return an URI for this file.
 */
public URI toURI() {
  String name = getAbsoluteName();
  try {
    if (!name.startsWith("/")) {
      // start with sep.
      return new URI("file", null, "/" + name, null, null);
    } else if (name.startsWith("//")) {
      return new URI("file", "", name, null); // UNC path
    }
    return new URI("file", null, name, null, null);
  } catch (URISyntaxException e) {
    // this should never happen
    return null;
  }
}
origin: robovm/robovm

/**
 * Returns a Uniform Resource Locator for this file. The URL is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return a URL for this file.
 * @throws java.net.MalformedURLException
 *             if the path cannot be transformed into a URL.
 * @deprecated Use {@link #toURI} and {@link java.net.URI#toURL} to
 * correctly escape illegal characters.
 */
@Deprecated
public URL toURL() throws java.net.MalformedURLException {
  String name = getAbsoluteName();
  if (!name.startsWith("/")) {
    // start with sep.
    return new URL("file", "", -1, "/" + name, null);
  } else if (name.startsWith("//")) {
    return new URL("file:" + name); // UNC path
  }
  return new URL("file", "", -1, name, null);
}
origin: MobiVM/robovm

/**
 * Returns a Uniform Resource Identifier for this file. The URI is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return an URI for this file.
 */
public URI toURI() {
  String name = getAbsoluteName();
  try {
    if (!name.startsWith("/")) {
      // start with sep.
      return new URI("file", null, "/" + name, null, null);
    } else if (name.startsWith("//")) {
      return new URI("file", "", name, null); // UNC path
    }
    return new URI("file", null, name, null, null);
  } catch (URISyntaxException e) {
    // this should never happen
    return null;
  }
}
origin: ibinti/bugvm

/**
 * Returns a Uniform Resource Locator for this file. The URL is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return a URL for this file.
 * @throws java.net.MalformedURLException
 *             if the path cannot be transformed into a URL.
 * @deprecated Use {@link #toURI} and {@link java.net.URI#toURL} to
 * correctly escape illegal characters.
 */
@Deprecated
public URL toURL() throws java.net.MalformedURLException {
  String name = getAbsoluteName();
  if (!name.startsWith("/")) {
    // start with sep.
    return new URL("file", "", -1, "/" + name, null);
  } else if (name.startsWith("//")) {
    return new URL("file:" + name); // UNC path
  }
  return new URL("file", "", -1, name, null);
}
origin: ibinti/bugvm

/**
 * Returns a Uniform Resource Identifier for this file. The URI is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return an URI for this file.
 */
public URI toURI() {
  String name = getAbsoluteName();
  try {
    if (!name.startsWith("/")) {
      // start with sep.
      return new URI("file", null, "/" + name, null, null);
    } else if (name.startsWith("//")) {
      return new URI("file", "", name, null); // UNC path
    }
    return new URI("file", null, name, null, null);
  } catch (URISyntaxException e) {
    // this should never happen
    return null;
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Returns a Uniform Resource Identifier for this file. The URI is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return an URI for this file.
 */
public URI toURI() {
  String name = getAbsoluteName();
  try {
    if (!name.startsWith("/")) {
      // start with sep.
      return new URI("file", null, "/" + name, null, null);
    } else if (name.startsWith("//")) {
      return new URI("file", "", name, null); // UNC path
    }
    return new URI("file", null, name, null, null);
  } catch (URISyntaxException e) {
    // this should never happen
    return null;
  }
}
origin: MobiVM/robovm

/**
 * Returns a Uniform Resource Locator for this file. The URL is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return a URL for this file.
 * @throws java.net.MalformedURLException
 *             if the path cannot be transformed into a URL.
 * @deprecated Use {@link #toURI} and {@link java.net.URI#toURL} to
 * correctly escape illegal characters.
 */
@Deprecated
public URL toURL() throws java.net.MalformedURLException {
  String name = getAbsoluteName();
  if (!name.startsWith("/")) {
    // start with sep.
    return new URL("file", "", -1, "/" + name, null);
  } else if (name.startsWith("//")) {
    return new URL("file:" + name); // UNC path
  }
  return new URL("file", "", -1, name, null);
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns a Uniform Resource Identifier for this file. The URI is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return an URI for this file.
 */
public URI toURI() {
  String name = getAbsoluteName();
  try {
    if (!name.startsWith("/")) {
      // start with sep.
      return new URI("file", null, "/" + name, null, null);
    } else if (name.startsWith("//")) {
      return new URI("file", "", name, null); // UNC path
    }
    return new URI("file", null, name, null, null);
  } catch (URISyntaxException e) {
    // this should never happen
    return null;
  }
}
origin: com.gluonhq/robovm-rt

/**
 * Returns a Uniform Resource Identifier for this file. The URI is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return an URI for this file.
 */
public URI toURI() {
  String name = getAbsoluteName();
  try {
    if (!name.startsWith("/")) {
      // start with sep.
      return new URI("file", null, "/" + name, null, null);
    } else if (name.startsWith("//")) {
      return new URI("file", "", name, null); // UNC path
    }
    return new URI("file", null, name, null, null);
  } catch (URISyntaxException e) {
    // this should never happen
    return null;
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Returns a Uniform Resource Locator for this file. The URL is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return a URL for this file.
 * @throws java.net.MalformedURLException
 *             if the path cannot be transformed into a URL.
 * @deprecated Use {@link #toURI} and {@link java.net.URI#toURL} to
 * correctly escape illegal characters.
 */
@Deprecated
public URL toURL() throws java.net.MalformedURLException {
  String name = getAbsoluteName();
  if (!name.startsWith("/")) {
    // start with sep.
    return new URL("file", "", -1, "/" + name, null);
  } else if (name.startsWith("//")) {
    return new URL("file:" + name); // UNC path
  }
  return new URL("file", "", -1, name, null);
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns a Uniform Resource Locator for this file. The URL is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return a URL for this file.
 * @throws java.net.MalformedURLException
 *             if the path cannot be transformed into a URL.
 * @deprecated Use {@link #toURI} and {@link java.net.URI#toURL} to
 * correctly escape illegal characters.
 */
@Deprecated
public URL toURL() throws java.net.MalformedURLException {
  String name = getAbsoluteName();
  if (!name.startsWith("/")) {
    // start with sep.
    return new URL("file", "", -1, "/" + name, null);
  } else if (name.startsWith("//")) {
    return new URL("file:" + name); // UNC path
  }
  return new URL("file", "", -1, name, null);
}
origin: FlexoVM/flexovm

/**
 * Returns a Uniform Resource Locator for this file. The URL is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return a URL for this file.
 * @throws java.net.MalformedURLException
 *             if the path cannot be transformed into a URL.
 * @deprecated Use {@link #toURI} and {@link java.net.URI#toURL} to
 * correctly escape illegal characters.
 */
@Deprecated
public URL toURL() throws java.net.MalformedURLException {
  String name = getAbsoluteName();
  if (!name.startsWith("/")) {
    // start with sep.
    return new URL("file", "", -1, "/" + name, null);
  } else if (name.startsWith("//")) {
    return new URL("file:" + name); // UNC path
  }
  return new URL("file", "", -1, name, null);
}
origin: com.gluonhq/robovm-rt

/**
 * Returns a Uniform Resource Locator for this file. The URL is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return a URL for this file.
 * @throws java.net.MalformedURLException
 *             if the path cannot be transformed into a URL.
 * @deprecated Use {@link #toURI} and {@link java.net.URI#toURL} to
 * correctly escape illegal characters.
 */
@Deprecated
public URL toURL() throws java.net.MalformedURLException {
  String name = getAbsoluteName();
  if (!name.startsWith("/")) {
    // start with sep.
    return new URL("file", "", -1, "/" + name, null);
  } else if (name.startsWith("//")) {
    return new URL("file:" + name); // UNC path
  }
  return new URL("file", "", -1, name, null);
}
origin: FlexoVM/flexovm

/**
 * Returns a Uniform Resource Identifier for this file. The URI is system
 * dependent and may not be transferable between different operating / file
 * systems.
 *
 * @return an URI for this file.
 */
public URI toURI() {
  String name = getAbsoluteName();
  try {
    if (!name.startsWith("/")) {
      // start with sep.
      return new URI("file", null, "/" + name, null, null);
    } else if (name.startsWith("//")) {
      return new URI("file", "", name, null); // UNC path
    }
    return new URI("file", null, name, null, null);
  } catch (URISyntaxException e) {
    // this should never happen
    return null;
  }
}
java.ioFilegetAbsoluteName

Popular methods of File

  • <init>
    Creates a new File instance by converting the givenfile: URI into an abstract pathname. The exact fo
  • exists
    Tests whether the file or directory denoted by this abstract pathname exists.
  • getAbsolutePath
    Returns the absolute pathname string of this abstract pathname. If this abstract pathname is already
  • getName
    Returns the name of the file or directory denoted by this abstract pathname. This is just the last n
  • isDirectory
  • mkdirs
  • delete
    Deletes the file or directory denoted by this abstract pathname. If this pathname denotes a director
  • listFiles
    Returns an array of abstract pathnames denoting the files and directories in the directory denoted b
  • getParentFile
    Returns the abstract pathname of this abstract pathname's parent, or null if this pathname does not
  • getPath
    Converts this abstract pathname into a pathname string. The resulting string uses the #separator to
  • isFile
  • length
    Returns the length of the file denoted by this abstract pathname. The return value is unspecified if
  • isFile,
  • length,
  • toURI,
  • createTempFile,
  • createNewFile,
  • toPath,
  • mkdir,
  • lastModified,
  • toString,
  • getCanonicalPath

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • BoxLayout (javax.swing)
  • JButton (javax.swing)
  • JCheckBox (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • CodeWhisperer 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