Home | History | Annotate | Download | only in lwjgl
      1 /*******************************************************************************
      2  * Copyright 2011 See AUTHORS file.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *   http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  ******************************************************************************/
     16 
     17 package com.badlogic.gdx.backends.lwjgl;
     18 
     19 import java.io.File;
     20 
     21 import com.badlogic.gdx.Files;
     22 import com.badlogic.gdx.files.FileHandle;
     23 
     24 /** @author mzechner
     25  * @author Nathan Sweet */
     26 public final class LwjglFiles implements Files {
     27 	static public final String externalPath = System.getProperty("user.home") + File.separator;
     28 	static public final String localPath = new File("").getAbsolutePath() + File.separator;
     29 
     30 	@Override
     31 	public FileHandle getFileHandle (String fileName, FileType type) {
     32 		return new LwjglFileHandle(fileName, type);
     33 	}
     34 
     35 	@Override
     36 	public FileHandle classpath (String path) {
     37 		return new LwjglFileHandle(path, FileType.Classpath);
     38 	}
     39 
     40 	@Override
     41 	public FileHandle internal (String path) {
     42 		return new LwjglFileHandle(path, FileType.Internal);
     43 	}
     44 
     45 	@Override
     46 	public FileHandle external (String path) {
     47 		return new LwjglFileHandle(path, FileType.External);
     48 	}
     49 
     50 	@Override
     51 	public FileHandle absolute (String path) {
     52 		return new LwjglFileHandle(path, FileType.Absolute);
     53 	}
     54 
     55 	@Override
     56 	public FileHandle local (String path) {
     57 		return new LwjglFileHandle(path, FileType.Local);
     58 	}
     59 
     60 	@Override
     61 	public String getExternalStoragePath () {
     62 		return externalPath;
     63 	}
     64 
     65 	@Override
     66 	public boolean isExternalStorageAvailable () {
     67 		return true;
     68 	}
     69 
     70 	@Override
     71 	public String getLocalStoragePath () {
     72 		return localPath;
     73 	}
     74 
     75 	@Override
     76 	public boolean isLocalStorageAvailable () {
     77 		return true;
     78 	}
     79 }
     80