Gridarta Editor
net.sf.gridarta.utils.IOUtils Class Reference
+ Collaboration diagram for net.sf.gridarta.utils.IOUtils:

Static Public Member Functions

static File findPathFile (@NotNull final String name) throws IOException
 
static File getCanonicalFile (@NotNull final File file)
 
static String getCanonicalPath (@NotNull final File file)
 
static File getFile (@NotNull final File dir, @NotNull final String fileName) throws IOException
 
static URL getResource (@NotNull final File dir, @NotNull final String fileName) throws FileNotFoundException
 

Static Public Attributes

static final String MAP_ENCODING = "iso-8859-1"
 

Private Member Functions

 IOUtils ()
 

Detailed Description

Utility-class for Gridarta's I/O.

Author
Christian Hujer

Definition at line 40 of file IOUtils.java.

Constructor & Destructor Documentation

◆ IOUtils()

net.sf.gridarta.utils.IOUtils.IOUtils ( )
private

Utility class - do not instantiate.

Definition at line 57 of file IOUtils.java.

Member Function Documentation

◆ findPathFile()

static File net.sf.gridarta.utils.IOUtils.findPathFile ( @NotNull final String  name) throws IOException
static

Searches for

file

on all paths specified by the environment variable "PATH".

Parameters
namethe file to search for
Returns
the matching file
Exceptions
IOExceptionif the file was not found

Definition at line 163 of file IOUtils.java.

Referenced by net.sf.gridarta.model.validation.checks.MapCheckerScriptChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.CommandFinder.getCommand().

+ Here is the caller graph for this function:

◆ getCanonicalFile()

◆ getCanonicalPath()

static String net.sf.gridarta.utils.IOUtils.getCanonicalPath ( @NotNull final File  file)
static

Calls File#getCanonicalPath(). If this fails, returns {}. file the file the absolute path

Definition at line 192 of file IOUtils.java.

Referenced by net.sf.gridarta.model.io.PathManager.getMapFile().

+ Here is the caller graph for this function:

◆ getFile()

static File net.sf.gridarta.utils.IOUtils.getFile ( @NotNull final File  dir,
@NotNull final String  fileName 
) throws IOException
static

Returns a File instance for a resource that is a regular file on the file system. Returns the passed file if it is a regular file. Otherwise copies the passed file into a temporary regular file and returns the copy.

Parameters
dirdirectory to read from
fileNamefile name of file to read
Returns
the file
Exceptions
IOExceptionif the file does not exist or cannot be copied to the file system

Definition at line 125 of file IOUtils.java.

References net.sf.gridarta.utils.IOUtils.getResource().

Referenced by net.sf.gridarta.model.configsource.AbstractConfigSource.getFile(), and net.sf.gridarta.model.face.DefaultFaceObjects.loadFacesCollection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getResource()

Member Data Documentation

◆ MAP_ENCODING

final String net.sf.gridarta.utils.IOUtils.MAP_ENCODING = "iso-8859-1"
static

Encoding to use for maps and other data. The encoding given here is used for reading and writing maps. You shouldn't change this only because you use an UTF-8 system or so, since the encoding used here MUST be compatible with the server and the client and the maps. The paragraph sign § is the critical character.

Todo:
once the mailing list decided on the § character, eventually replace by "us-ascii".

Definition at line 52 of file IOUtils.java.

Referenced by net.sf.gridarta.utils.MapFileFilter.accept(), net.sf.gridarta.model.collectable.SmoothFacesCollectable.collect(), net.sf.gridarta.model.collectable.AbstractArchetypeSetCollectable< GameObject, MapArchObject, Archetype >.collect(), net.sf.gridarta.model.collectable.AnimationObjectsCollectable.collectAnimations(), net.sf.gridarta.model.collectable.AnimationObjectsCollectable.collectAnimTree(), net.sf.gridarta.model.io.DefaultMapReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.DefaultMapReader(), net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.encodeMapFile(), net.sf.gridarta.model.validation.checks.MapCheckerScriptChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getCommand(), net.sf.gridarta.model.smoothface.SmoothFacesLoader.load(), net.sf.gridarta.model.gameobject.MultiPositionData.load(), net.sf.gridarta.model.io.AnimationObjectsReader.loadAnimations(), net.sf.gridarta.model.resource.AbstractResourcesReader< G >.loadAnimationsFromCollect(), net.sf.gridarta.model.resource.AbstractResourcesReader< G >.loadAnimTree(), net.sf.gridarta.model.resource.AbstractCollectedResourcesReader< GameObject, MapArchObject, Archetype >.loadArchetypes(), net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.loadArchetypesFromFiles(), net.sf.gridarta.model.artifact.ArtifactParser< net.sf.gridarta.model.gameobject.TestGameObject, net.sf.gridarta.model.maparchobject.TestMapArchObject, net.sf.gridarta.model.archetype.TestArchetype >.loadArtifact(), net.sf.gridarta.model.face.DefaultFaceObjects.loadFacesCollection(), net.sf.gridarta.model.treasurelist.TreasureLoader.loadTreasureList(), net.sf.gridarta.textedit.scripteditor.MenuEntries.MenuEntries(), and net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.parseDefFace().


The documentation for this class was generated from the following file: