1 /*******************************************************************************
\r
2 * Copyright 2011 See AUTHORS file.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
15 ******************************************************************************/
16 package com.badlogic.gdx.backends.ios;
18 import cli.System.Environment;
19 import cli.System.IO.Directory;
21 import com.badlogic.gdx.Files;
22 import com.badlogic.gdx.files.FileHandle;
23 import com.badlogic.gdx.utils.GdxRuntimeException;
\r
25 public class IOSFiles implements Files {
26 static final String externalPath = Environment.GetFolderPath(Environment.SpecialFolder.wrap(Environment.SpecialFolder.MyDocuments));
27 static final String localPath = Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.wrap(Environment.SpecialFolder.MyDocuments))).ToString() + "/Library/local";
30 new FileHandle(externalPath).mkdirs();
31 new FileHandle(localPath).mkdirs();
35 public FileHandle getFileHandle (String fileName, FileType type) {
36 return new IOSFileHandle(fileName, type);
40 public FileHandle classpath (String path) {
\r
41 throw new GdxRuntimeException("Classpath files are not supported on iOS, this likely happened because you used the default constructor of BitmapFont.");
45 public FileHandle internal (String path) {
46 return new IOSFileHandle(path, FileType.Internal);
50 public FileHandle external (String path) {
51 return new IOSFileHandle(path, FileType.External);
55 public FileHandle absolute (String path) {
56 return new IOSFileHandle(path, FileType.Absolute);
60 public FileHandle local (String path) {
61 return new IOSFileHandle(path, FileType.Local);
65 public String getExternalStoragePath() {
70 public boolean isExternalStorageAvailable() {
75 public String getLocalStoragePath() {
\r
76 // FIXME this doesn't seem to work
81 public boolean isLocalStorageAvailable() {