Giter Site home page Giter Site logo

pclext / pclext.filestorage Goto Github PK

View Code? Open in Web Editor NEW
34.0 7.0 3.0 1.27 MB

Portable Storage APIs

Home Page: https://filestorage.aragas.org

License: MIT License

C# 97.16% PowerShell 2.84%
filestorage xamarin pclext storage-api netstandard portable netframework uwp mono bait-and-switch

pclext.filestorage's Introduction

.NET 4.5 & Mono & .NET Core NuGet Coveralls Codecov

Build status

NuGet

Coverage Status

codecov

.NET 4.5 & Mono & .NET Core NuGet devel Coveralls devel Codecov devel

AppVeyor tests

NuGet devel

Coverage Status

codecov

PCLExt.FileStorage

PCLExt.FileStorage

PCLExt.FileStorage is a bait-and-switch library that was designed to implement a storage API in portable(PCL) projects.
It was formely a basic fork of PCL Storage, but later formed it's own set of API's designed to ease use of files and folders in managed code. It has a more "OOP" approach.

PCLExt.FileStorage supports .NET Framework (4.5), .NET Standard (2.0), Xamarin.iOS, Xamarin.Android, Xamarin.Mac and UWP. This makes it easier to create cross-platform .NET libraries and apps.

Documentation

Examples and API documentation can be found here.

pclext.filestorage's People

Contributors

aragas avatar artjomp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pclext.filestorage's Issues

Missing UWP support

In version 1.4.0 support for UWP had been removed. Until now, it hasn't been added again. Is there a timeline when UWP will be supported again?

Add release and tags

Can you please add release and tags corresponding to your nuget versions :

  • 1.3.1
  • 1.3.0
  • 1.2.1.1
  • 1.2.0.1
  • 1.1.4

Full working Sample

Hi,

I tried to replace PCLStorage with PCLExt.FileStorage and found the JSON and Log examples, but I didn't get it working.

I want to do something like:

var rootFolder = new ApplicationRootFolder();
await rootFolder.CreateFolderAsync(FileStoreConstants.TmpFolderName, CreationCollisionOption.OpenIfExists);

But I always get a NullReference Exception on rootFolder.

I'm using a Xamarin.Forms Solution with UWP, Android, iOS and .netstandard2.0 libararies (refer to the latest Prism Template Pack).
I also tried to instantiate the root folder directly in the several platform project without success.
The library is installed via nuget in the main project, the three platform projects (UWP, Android, iOS) and one or two libraries.

What I'm doing wrong? Is it possible to get a full working sample solution?

CheckExists and CheckExists

var rootFolder = new LocalRootFolder();
ExistenceCheckResult exists = await rootFolder.CheckExistsAsync("test.zip");

This like causes an exception in UWP and stops my app. Also,

var rootFolder = new LocalRootFolder();
ExistenceCheckResult exists = rootFolder.CheckExists("test.zip");

This causes Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll and freezes the app.

Am I using these incorrectly, or is there an issue?? Please help. I need to check if files exists. Thank you so much for your help. Seems like a great extension.

Add some documentation

Hi,

Can you please add some documentation in your README.md ?
May be, just copy/paste orignal plugin library.

Have you add some new methods yet ?

CreateFile freezes on UWP but not on Android.

IFile file = new FolderFromPath(_rootPath + dirSeperator + path) .CreateFile(name, CreationCollisionOption.ReplaceExisting);

This freezes on UWP but not on Android. All CreationCollisionOption choices freeze. Note that the file is created, but then the application freezes without throwing an exception.

Make every CancellationToken optionals

Hi can you please make every "CancellationToken" optionals ?

Here are some methods where CancellationToken is not optional :

-BaseFile.ReadAllBytesAsync
-BaseFile.WriteAllBytesAsync

Thank you ๐Ÿ˜Š

File exist

How to check a file weather exist or not based on file path, without catch exception?

UWP tests don't work

Hi there!
It seems that NUnit doesn't support UWP tests.
Do you mind if I change UWP tests from NUnit to MS test?
It will require some conditional variables for every test. Something like this:
#ifdef UWP [TestMethod] #else [Test] #endif

Or am I wrong and UWP tests actually work well?
May be any other ideas.

Install error

Please,

A error occur for me when I try install:

Could not install package 'PCLExt.FileStorage 1.3.2'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

I use Xamarin.Forms in Visual Studio 2015.

BaseFile.MoveAsync(string newPath)

Hi, this method is not working.
It removes the file available at BaseFile.Path, but it does NOT copy the file in "newPath".

Can you try this code, and check that the file is correctly moved :

var path = "/storage/emulated/0/Android/data/test/temp/20171114.jpg";
var newPath = "/storage/emulated/0/Android/data/test/20171114.jpg";
var file = new FileFromPath(path);
var newFile = await file.MoveAsync(newPath);
// OK newFile.Path is egal to newPath
// But there is no file with path "/storage/emulated/0/Android/data/test/20171114.jpg"
// File is deleted but not moved :(

I use :

  • .Net Standard 2.0 Class library
  • PCLEct.FileStorage 1.3.1
  • Xamarin.forms
  • Device with Android 6.0

Please test this code, and tell me if the file is really moved on an android device.
(Or maybe you can test it in a windows console app...)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.