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 ******************************************************************************/
\r
17 package com.badlogic.gdx.backends.gwt;
\r
19 import com.badlogic.gdx.Files;
\r
20 import com.badlogic.gdx.backends.gwt.preloader.Preloader;
\r
21 import com.badlogic.gdx.files.FileHandle;
\r
22 import com.badlogic.gdx.utils.GdxRuntimeException;
\r
24 public class GwtFiles implements Files {
\r
25 final Preloader preloader;
\r
27 public GwtFiles (Preloader preloader) {
\r
28 this.preloader = preloader;
\r
32 public FileHandle getFileHandle (String path, FileType type) {
\r
33 if (type != FileType.Internal) throw new GdxRuntimeException("FileType '" + type + "' not supported in GWT backend");
\r
34 return new GwtFileHandle(preloader, path, type);
\r
38 public FileHandle classpath (String path) {
\r
39 return new GwtFileHandle(preloader, path, FileType.Classpath);
\r
40 // throw new GdxRuntimeException("Not supported in GWT backend");
\r
44 public FileHandle internal (String path) {
\r
45 return new GwtFileHandle(preloader, path, FileType.Internal);
\r
49 public FileHandle external (String path) {
\r
50 throw new GdxRuntimeException("Not supported in GWT backend");
\r
54 public FileHandle absolute (String path) {
\r
55 throw new GdxRuntimeException("Not supported in GWT backend");
\r
59 public FileHandle local (String path) {
\r
60 throw new GdxRuntimeException("Not supported in GWT backend");
\r
64 public String getExternalStoragePath () {
\r
69 public boolean isExternalStorageAvailable () {
\r
74 public String getLocalStoragePath () {
\r
79 public boolean isLocalStorageAvailable () {
\r