cordova-plugin-file
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -38,3 +38,3 @@ <!--- | ||
Auf Android, die einfachste Methode zum Konvertieren eines `cdvfile://` darin, dass die URL zu einem Dateisystempfad verwenden `cordova-plugin-CordovaResourceApi` . `CordovaResourceApi`verfügt über mehrere Methoden der verarbeiten kann `cdvfile://` URLs: | ||
Auf Android, die einfachste Methode zum Konvertieren eines `cdvfile://` darin, dass die URL zu einem Dateisystempfad verwenden `org.apache.cordova.CordovaResourceApi` . `CordovaResourceApi`verfügt über mehrere Methoden der verarbeiten kann `cdvfile://` URLs: | ||
@@ -51,4 +51,4 @@ // webView is a member of the Plugin class | ||
import cordova-plugin-file.FileUtils; | ||
import cordova-plugin-file.FileSystem; | ||
import org.apache.cordova.file.FileUtils; | ||
import org.apache.cordova.file.FileSystem; | ||
import java.net.MalformedURLException; | ||
@@ -69,3 +69,3 @@ | ||
import cordova-plugin-file.LocalFilesystemURL; | ||
import org.apache.cordova.file.LocalFilesystemURL; | ||
@@ -127,2 +127,2 @@ // Get a LocalFilesystemURL object for a device path, | ||
entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); | ||
} | ||
} |
@@ -38,3 +38,3 @@ <!--- | ||
En Android, el método más sencillo para convertir un `cdvfile://` URL a una ruta de sistema de archivos es utilizar `cordova-plugin-CordovaResourceApi` . `CordovaResourceApi`tiene varios métodos que pueden manejar `cdvfile://` URLs: | ||
En Android, el método más sencillo para convertir un `cdvfile://` URL a una ruta de sistema de archivos es utilizar `org.apache.cordova.CordovaResourceApi` . `CordovaResourceApi`tiene varios métodos que pueden manejar `cdvfile://` URLs: | ||
@@ -51,4 +51,4 @@ // webView is a member of the Plugin class | ||
import cordova-plugin-file.FileUtils; | ||
import cordova-plugin-file.FileSystem; | ||
import org.apache.cordova.file.FileUtils; | ||
import org.apache.cordova.file.FileSystem; | ||
import java.net.MalformedURLException; | ||
@@ -69,3 +69,3 @@ | ||
import cordova-plugin-file.LocalFilesystemURL; | ||
import org.apache.cordova.file.LocalFilesystemURL; | ||
@@ -127,2 +127,2 @@ // Get a LocalFilesystemURL object for a device path, | ||
entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); | ||
} | ||
} |
@@ -38,3 +38,3 @@ <!--- | ||
Sur Android, la méthode la plus simple pour convertir un `cdvfile://` URL vers un chemin d'accès de système de fichiers est d'utiliser `cordova-plugin-CordovaResourceApi` . `CordovaResourceApi`comporte plusieurs méthodes qui peuvent gérer `cdvfile://` URL : | ||
Sur Android, la méthode la plus simple pour convertir un `cdvfile://` URL vers un chemin d'accès de système de fichiers est d'utiliser `org.apache.cordova.CordovaResourceApi` . `CordovaResourceApi`comporte plusieurs méthodes qui peuvent gérer `cdvfile://` URL : | ||
@@ -51,4 +51,4 @@ // webView is a member of the Plugin class | ||
import cordova-plugin-file.FileUtils; | ||
import cordova-plugin-file.FileSystem; | ||
import org.apache.cordova.file.FileUtils; | ||
import org.apache.cordova.file.FileSystem; | ||
import java.net.MalformedURLException; | ||
@@ -69,3 +69,3 @@ | ||
import cordova-plugin-file.LocalFilesystemURL; | ||
import org.apache.cordova.file.LocalFilesystemURL; | ||
@@ -127,2 +127,2 @@ // Get a LocalFilesystemURL object for a device path, | ||
entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); | ||
} | ||
} |
@@ -38,3 +38,3 @@ <!--- | ||
Su Android, il metodo più semplice per convertire un `cdvfile://` URL a un percorso di file System è quello di utilizzare `cordova-plugin-CordovaResourceApi` . `CordovaResourceApi`dispone di diversi metodi in grado di gestire `cdvfile://` URL: | ||
Su Android, il metodo più semplice per convertire un `cdvfile://` URL a un percorso di file System è quello di utilizzare `org.apache.cordova.CordovaResourceApi` . `CordovaResourceApi`dispone di diversi metodi in grado di gestire `cdvfile://` URL: | ||
@@ -51,4 +51,4 @@ // webView is a member of the Plugin class | ||
import cordova-plugin-file.FileUtils; | ||
import cordova-plugin-file.FileSystem; | ||
import org.apache.cordova.file.FileUtils; | ||
import org.apache.cordova.file.FileSystem; | ||
import java.net.MalformedURLException; | ||
@@ -69,3 +69,3 @@ | ||
import cordova-plugin-file.LocalFilesystemURL; | ||
import org.apache.cordova.file.LocalFilesystemURL; | ||
@@ -127,2 +127,2 @@ // Get a LocalFilesystemURL object for a device path, | ||
entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); | ||
} | ||
} |
@@ -38,3 +38,3 @@ <!--- | ||
Android 上で変換する最も簡単な方法は `cdvfile://` を使用してファイルシステムのパスに URL が `cordova-plugin-CordovaResourceApi` 。 `CordovaResourceApi`扱うことができるいくつかの方法があります `cdvfile://` Url: | ||
Android 上で変換する最も簡単な方法は `cdvfile://` を使用してファイルシステムのパスに URL が `org.apache.cordova.CordovaResourceApi` 。 `CordovaResourceApi`扱うことができるいくつかの方法があります `cdvfile://` Url: | ||
@@ -51,4 +51,4 @@ // webView is a member of the Plugin class | ||
import cordova-plugin-file.FileUtils; | ||
import cordova-plugin-file.FileSystem; | ||
import org.apache.cordova.file.FileUtils; | ||
import org.apache.cordova.file.FileSystem; | ||
import java.net.MalformedURLException; | ||
@@ -69,3 +69,3 @@ | ||
import cordova-plugin-file.LocalFilesystemURL; | ||
import org.apache.cordova.file.LocalFilesystemURL; | ||
@@ -127,2 +127,2 @@ // Get a LocalFilesystemURL object for a device path, | ||
entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); | ||
} | ||
} |
@@ -38,3 +38,3 @@ <!--- | ||
안 드 로이드, 변환 하는 간단한 방법에는 `cdvfile://` URL을 파일 시스템 경로 사용 하는 `cordova-plugin-CordovaResourceApi` . `CordovaResourceApi`처리할 수 있는 여러 가지 방법에는 `cdvfile://` Url: | ||
안 드 로이드, 변환 하는 간단한 방법에는 `cdvfile://` URL을 파일 시스템 경로 사용 하는 `org.apache.cordova.CordovaResourceApi` . `CordovaResourceApi`처리할 수 있는 여러 가지 방법에는 `cdvfile://` Url: | ||
@@ -51,4 +51,4 @@ // webView is a member of the Plugin class | ||
import cordova-plugin-file.FileUtils; | ||
import cordova-plugin-file.FileSystem; | ||
import org.apache.cordova.file.FileUtils; | ||
import org.apache.cordova.file.FileSystem; | ||
import java.net.MalformedURLException; | ||
@@ -69,3 +69,3 @@ | ||
import cordova-plugin-file.LocalFilesystemURL; | ||
import org.apache.cordova.file.LocalFilesystemURL; | ||
@@ -127,2 +127,2 @@ // Get a LocalFilesystemURL object for a device path, | ||
entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); | ||
} | ||
} |
@@ -38,3 +38,3 @@ <!--- | ||
Na Android, najprostsza metoda konwersji `cdvfile://` URL do ścieżki systemu plików jest użycie `cordova-plugin-CordovaResourceApi` . `CordovaResourceApi`jest kilka metod, które mogą obsługiwać `cdvfile://` adresów URL: | ||
Na Android, najprostsza metoda konwersji `cdvfile://` URL do ścieżki systemu plików jest użycie `org.apache.cordova.CordovaResourceApi` . `CordovaResourceApi`jest kilka metod, które mogą obsługiwać `cdvfile://` adresów URL: | ||
@@ -51,4 +51,4 @@ // webView is a member of the Plugin class | ||
import cordova-plugin-file.FileUtils; | ||
import cordova-plugin-file.FileSystem; | ||
import org.apache.cordova.file.FileUtils; | ||
import org.apache.cordova.file.FileSystem; | ||
import java.net.MalformedURLException; | ||
@@ -69,3 +69,3 @@ | ||
import cordova-plugin-file.LocalFilesystemURL; | ||
import org.apache.cordova.file.LocalFilesystemURL; | ||
@@ -127,2 +127,2 @@ // Get a LocalFilesystemURL object for a device path, | ||
entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); | ||
} | ||
} |
@@ -38,3 +38,3 @@ <!--- | ||
在 android 系統,最簡單的方法來轉換 `cdvfile://` 檔案系統路徑的 URL 是使用 `cordova-plugin-CordovaResourceApi` 。 `CordovaResourceApi`有幾種方法,可處理 `cdvfile://` 的 Url: | ||
在 android 系統,最簡單的方法來轉換 `cdvfile://` 檔案系統路徑的 URL 是使用 `org.apache.cordova.CordovaResourceApi` 。 `CordovaResourceApi`有幾種方法,可處理 `cdvfile://` 的 Url: | ||
@@ -51,4 +51,4 @@ // webView is a member of the Plugin class | ||
import cordova-plugin-file.FileUtils; | ||
import cordova-plugin-file.FileSystem; | ||
import org.apache.cordova.file.FileUtils; | ||
import org.apache.cordova.file.FileSystem; | ||
import java.net.MalformedURLException; | ||
@@ -69,3 +69,3 @@ | ||
import cordova-plugin-file.LocalFilesystemURL; | ||
import org.apache.cordova.file.LocalFilesystemURL; | ||
@@ -127,2 +127,2 @@ // Get a LocalFilesystemURL object for a device path, | ||
entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); | ||
} | ||
} |
{ | ||
"name": "cordova-plugin-file", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Cordova File Plugin", | ||
@@ -22,3 +22,3 @@ "cordova": { | ||
"type": "git", | ||
"url": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git" | ||
"url": "https://github.com/apache/cordova-plugin-file" | ||
}, | ||
@@ -25,0 +25,0 @@ "keywords": [ |
@@ -1,18 +0,18 @@ | ||
<!--- | ||
license: Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
<!-- | ||
# license: Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
--> | ||
@@ -19,0 +19,0 @@ |
@@ -356,1 +356,10 @@ <!-- | ||
* Added nativeURL property to FileEntry, implemented readAsArrayBuffer and readAsBinaryString | ||
### 2.1.0 (Jun 17, 2015) | ||
* added missing license header | ||
* CB-9128 cordova-plugin-file documentation translation: cordova-plugin-file | ||
* fix npm md | ||
* CB-8844 Increased timeout for asset tests | ||
* Updated resolveFileSystem.js so it can be parsed by uglifyJS | ||
* CB-8860 cordova-plugin-file documentation translation: cordova-plugin-file | ||
* CB-8792 Fixes reading of json files using readAsText |
@@ -55,7 +55,38 @@ /* | ||
var writeBytesAsync = Windows.Storage.FileIO.writeBytesAsync; | ||
var writeTextAsync = Windows.Storage.FileIO.writeTextAsync; | ||
var writeBlobAsync = function writeBlobAsync(storageFile, data) { | ||
function writeBytesAsync(storageFile, data, position) { | ||
return storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite) | ||
.then(function (output) { | ||
output.seek(position); | ||
var dataWriter = new Windows.Storage.Streams.DataWriter(output); | ||
dataWriter.writeBytes(data); | ||
return dataWriter.storeAsync().then(function (size) { | ||
output.size = position+size; | ||
return dataWriter.flushAsync().then(function() { | ||
output.close(); | ||
return size; | ||
}); | ||
}); | ||
}); | ||
} | ||
function writeTextAsync(storageFile, data, position) { | ||
return storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite) | ||
.then(function (output) { | ||
output.seek(position); | ||
var dataWriter = new Windows.Storage.Streams.DataWriter(output); | ||
dataWriter.writeString(data); | ||
return dataWriter.storeAsync().then(function (size) { | ||
output.size = position+size; | ||
return dataWriter.flushAsync().then(function() { | ||
output.close(); | ||
return size; | ||
}); | ||
}); | ||
}); | ||
} | ||
function writeBlobAsync(storageFile, data, position) { | ||
return storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite) | ||
.then(function (output) { | ||
output.seek(position); | ||
var dataSize = data.size; | ||
@@ -67,2 +98,3 @@ var input = (data.detachStream || data.msDetachStream).call(data); | ||
.then(function () { | ||
output.size = position+dataSize; | ||
return output.flushAsync().then(function () { | ||
@@ -76,7 +108,7 @@ input.close(); | ||
}); | ||
}; | ||
} | ||
var writeArrayBufferAsync = function writeArrayBufferAsync(storageFile, data) { | ||
return writeBlobAsync(storageFile, new Blob([data])); | ||
}; | ||
function writeArrayBufferAsync(storageFile, data, position) { | ||
return writeBlobAsync(storageFile, new Blob([data]), position); | ||
} | ||
@@ -1002,3 +1034,3 @@ function cordovaPathToNative(path) { | ||
function (storageFile) { | ||
writePromise(storageFile, data).done( | ||
writePromise(storageFile, data, position).done( | ||
function (bytesWritten) { | ||
@@ -1005,0 +1037,0 @@ var written = bytesWritten || data.length; |
@@ -23,7 +23,10 @@ /* | ||
//For browser platform: not all browsers use this file. | ||
if (cordova.platformId === "browser" && navigator.userAgent.search(/Chrome/) > 0) { | ||
var requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; | ||
module.exports = requestFileSystem; | ||
return; | ||
function checkBrowser() { | ||
if (cordova.platformId === "browser" && navigator.userAgent.search(/Chrome/) > 0) { | ||
var requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; | ||
module.exports = requestFileSystem; | ||
return; | ||
} | ||
} | ||
checkBrowser(); | ||
@@ -30,0 +33,0 @@ var argscheck = require('cordova/argscheck'), |
@@ -23,6 +23,10 @@ /* | ||
//For browser platform: not all browsers use overrided `resolveLocalFileSystemURL`. | ||
if (cordova.platformId == "browser" && navigator.userAgent.search(/Chrome/) > 0) { | ||
module.exports.resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL; | ||
return; | ||
function checkBrowser() { | ||
if (cordova.platformId === "browser" && navigator.userAgent.search(/Chrome/) > 0) { | ||
var requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; | ||
module.exports = requestFileSystem; | ||
return; | ||
} | ||
} | ||
checkBrowser(); | ||
@@ -29,0 +33,0 @@ var argscheck = require('cordova/argscheck'), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1417661
119
9978