/* * [FileType.java] * * Summary: Enumeration of the various types of streams/files that Java can read or write. * * Copyright: (c) 1997-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2007-07-12 Created with IntelliJ IDEA. */ package com.mindprod.fileio; /** * Enumeration of the various types of streams/files that Java can read or write. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2007-07-12 Created with IntelliJ IDEA. * @since 2007-07-12 */ public enum FileType { /** * out console */ CONSOLE( "console" ), /** * read a resource. */ RESOURCE( "resource" ), /** * I/O to a sequential disk file. */ SEQUENTIAL( "sequential file" ), /** * I/O to a random access file */ RANDOM( "random access file" ), /** * I/O to a memory-resident String */ STRING( "String" ), /** * I/O to a memory-resident array of 16-bit chars. */ CHARARRAY( "char[]" ), /** * I/O to a memory-resident array of 8-bit bytes. */ BYTEARRAY( "byte[]" ), /** * I/O to a URL, usually a remote machine. */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) URL( "URL" ), /** * I/O to and HTTP URL via GET/POST. */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) HTTP( "HTTP GET/POST" ), /** * I/O to a socket */ SOCKET( "socket" ), /** * I/O to a pipe */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) PIPE( "pipe" ); /** * description of the enum */ private final String desc; /** * constructor * * @param desc wording to describe this type of data */ FileType( String desc ) { this.desc = desc; } /** * HowToProcess we display this enum. * * @return description. */ public String toString() { return desc; } }