Java URI Value Check isVirtual(URI locationURI)

Here you can find the source of isVirtual(URI locationURI)

Description

see issue 12500: we should check whether the resource is virtual

TODO as soon as 3.5 is not supported, use resource.isVirtual() call

License

Open Source License

Parameter

Parameter Description
locationURI may be null

Return

true if the given path is null OR is virtual location

Declaration

public static boolean isVirtual(URI locationURI) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005-2009 VecTrace (Zingo Andersen) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from  w  ww.j  a  va 2 s .  c  o  m*/
 *     bastian                  - implementation
 *     Andrei Loskutov         - bugfixes
 *     Zsolt Koppany (Intland)
 *******************************************************************************/

import java.net.URI;

public class Main {
    /**
     * see issue 12500: we should check whether the resource is virtual
     * <p>
     * TODO as soon as 3.5 is not supported, use resource.isVirtual() call
     *
     * @param locationURI
     *            may be null
     * @return true if the given path is null OR is virtual location
     */
    public static boolean isVirtual(URI locationURI) {
        return locationURI == null || "virtual".equals(locationURI.getScheme());
    }
}

Related

  1. isValidUri(String uri, StringBuilder errMsg)
  2. isValidUri(String uriCandidate)
  3. isValidURI(String uriRef)
  4. isValidURIorEmpty(String uri)
  5. isValidURIReference(String uriRef)
  6. isVSO(final URI uri)
  7. isWellFormedUriString(final String uriString)
  8. validateURI(final String uri)
  9. validateUri(String uri)