Java Resource File isFullIRI(String resource)

Here you can find the source of isFullIRI(String resource)

Description

Determines if the resource is a full iri

License

Open Source License

Parameter

Parameter Description
resource the resource

Return

true if the resource if a full ontology iri

Declaration

private static boolean isFullIRI(String resource) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2009,2011 Tecnalia Research and Innovation.
 * 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 v  a  2s  . c o m
 *    Raul Otaolea (Tecnalia Research and Innovation - Software Systems Engineering) - initial API, implementation and documentation
 *    Fran Ruiz (Tecnalia Research and Innovation - Software Systems Engineering) - initial API, implementation and documentation
 *******************************************************************************/

import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    /**
     * Determines if the resource is a full iri
     * @param resource the resource
     * @return <code>true</code> if the resource if a full ontology iri
     */
    private static boolean isFullIRI(String resource) {
        try {
            new URL(resource);
            return true;
        } catch (MalformedURLException ex) {
            return false;
        }
    }
}

Related

  1. getShortName(String resource, Map nsMap)
  2. getSourceForResource(String s)
  3. getStreamFromResource(Class clazz, String resourceName)
  4. getTestResourceFile(String pName, Class pClass)
  5. inputStream(Class baseClass, String resourceName)
  6. loadAutoConfigFiles(ClassLoader classLoader, String resourceName)
  7. loadConfigFile(String resource, Class clazz)
  8. loadUTF8(String resource)
  9. openInputStream(String resourceString, ClassLoader classLoader)