001 /* 002 * Copyright (c) 2007-2015 Concurrent, Inc. All Rights Reserved. 003 * 004 * Project and contact information: http://www.cascading.org/ 005 * 006 * This file is part of the Cascading project. 007 * 008 * Licensed under the Apache License, Version 2.0 (the "License"); 009 * you may not use this file except in compliance with the License. 010 * You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, software 015 * distributed under the License is distributed on an "AS IS" BASIS, 016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 017 * See the License for the specific language governing permissions and 018 * limitations under the License. 019 */ 020 021 package cascading.tap.type; 022 023 import java.io.IOException; 024 025 /** Interface FileType marks specific platform {@link cascading.tap.Tap} classes as representing a file like interface. */ 026 public interface FileType<Config> 027 { 028 /** 029 * Method isDirectory returns true if the underlying resource represents a directory or folder instead 030 * of an individual file. 031 * 032 * @param conf of JobConf 033 * @return boolean 034 * @throws java.io.IOException 035 */ 036 boolean isDirectory( Config conf ) throws IOException; 037 038 /** 039 * Method getChildIdentifiers returns an array of child identifiers if this resource is a directory. 040 * <p/> 041 * This method will skip Hadoop log directories ({@code _log}). 042 * 043 * @param conf of JobConf 044 * @return String[] 045 * @throws java.io.IOException 046 */ 047 String[] getChildIdentifiers( Config conf ) throws IOException; 048 049 String[] getChildIdentifiers( Config conf, int depth, boolean fullyQualified ) throws IOException; 050 051 /** 052 * Method getSize returns the size of the file referenced by this tap. 053 * 054 * @param conf of type Config 055 * @return The size of the file reference by this tap. 056 * @throws java.io.IOException 057 */ 058 long getSize( Config conf ) throws IOException; 059 }