Skip to content

Commit 3a564bc

Browse files
author
samuel.cardoso
committed
Issue CruxFramework#6: Implement support for cordova-plugin-cache
1 parent e4d4234 commit 3a564bc

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright 2013 cruxframework.org.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* 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, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package org.cruxframework.crux.plugin.cordova.client.plugin.cache;
17+
18+
import jsinterop.annotations.JsFunction;
19+
import jsinterop.annotations.JsPackage;
20+
import jsinterop.annotations.JsType;
21+
22+
/**
23+
* @author Samuel Almeida Cardoso
24+
* Pluggin mapping for: https://github.com/moderna/cordova-plugin-cache
25+
*/
26+
@JsType(namespace=JsPackage.GLOBAL, name="cache")
27+
public class CacheHandlerPlugin
28+
{
29+
private CacheHandlerPlugin(){}
30+
31+
public static native void clear(CacheSuccessCallback cacheSuccessCallback,
32+
CacheErrorCallback cacheErrorCallback);
33+
34+
@JsFunction
35+
public static interface CacheSuccessCallback
36+
{
37+
void onSuccess(String status);
38+
}
39+
40+
@JsFunction
41+
public static interface CacheErrorCallback
42+
{
43+
void onError(String status);
44+
}
45+
}

src/main/java/org/cruxframework/crux/plugin/cordova/client/plugin/sqlite/SQLDatabaseFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static class SQLDatabaseParameters
3737
public int androidDatabaseImplementation;
3838
public int androidLockWorkaround;
3939
public int createFromLocation;
40-
public int location;
40+
public String location;
4141
public String name;
4242
}
4343
}

0 commit comments

Comments
 (0)