Here you can find the source of isDirectory(URI orig)
Parameter | Description |
---|---|
orig | The URI to check |
public static boolean isDirectory(URI orig)
//package com.java2s; /**/* ww w . j a v a 2 s. c o m*/ * Distribution License: * JSword is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License, version 2.1 as published by * the Free Software Foundation. This program is distributed in the hope * that it will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * The License is available on the internet at: * http://www.gnu.org/copyleft/lgpl.html * or by writing to: * Free Software Foundation, Inc. * 59 Temple Place - Suite 330 * Boston, MA 02111-1307, USA * * Copyright: 2005 * The copyright to this program is held by it's authors. * * ID: $Id$ */ import java.io.File; import java.net.URI; public class Main { /** * Constant for the file: protocol or scheme */ public static final String PROTOCOL_FILE = "file"; /** * If there is a directory at the other end of this URI return true. Note * non file: type URI will always return false * * @param orig * The URI to check * @return true if the URI points at a file: directory */ public static boolean isDirectory(URI orig) { if (!orig.getScheme().equals(PROTOCOL_FILE)) { return false; } return new File(orig.getPath()).isDirectory(); } }