cuberact-storage

Simple and unified access to files in zip/jar file or directory

Лицензия

Лицензия

Группа

Группа

org.cuberact
Идентификатор

Идентификатор

cuberact-storage
Последняя версия

Последняя версия

1.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

cuberact-storage
Simple and unified access to files in zip/jar file or directory
Ссылка на сайт

Ссылка на сайт

https://github.com/cuberact/cuberact-storage
Система контроля версий

Система контроля версий

https://github.com/cuberact/cuberact-storage

Скачать cuberact-storage

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.cuberact/cuberact-storage/ -->
<dependency>
    <groupId>org.cuberact</groupId>
    <artifactId>cuberact-storage</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.cuberact/cuberact-storage/
implementation 'org.cuberact:cuberact-storage:1.1.1'
// https://jarcasting.com/artifacts/org.cuberact/cuberact-storage/
implementation ("org.cuberact:cuberact-storage:1.1.1")
'org.cuberact:cuberact-storage:jar:1.1.1'
<dependency org="org.cuberact" name="cuberact-storage" rev="1.1.1">
  <artifact name="cuberact-storage" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.cuberact', module='cuberact-storage', version='1.1.1')
)
libraryDependencies += "org.cuberact" % "cuberact-storage" % "1.1.1"
[org.cuberact/cuberact-storage "1.1.1"]

Зависимости

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.mockito : mockito-core jar 2.12.0

Модули Проекта

Данный проект не имеет модулей.

cuberact-resources

FileSystem abstraction

Goals

  • simple and unified access to files in zip/jar file or directory
  • deferred write to file - usefull in event system

Examples

Basic example
Storage storage = new Storage("path/to/directory/or/zip-file");
Resource resource = storage.getResource("first_file");
resource.write("hello", false);
resource.write(" world", true);

//and somewhere 
Resource resource = storage.findResource("*file");
String helloWorld = resource.readToString();
Read all png from classpath (directories or jars)
URLClassLoader CLASSLOADER = (URLClassLoader) ClassLoader.getSystemClassLoader();
URL[] urls = CLASSLOADER.getURLs();
for (URL url : urls) {
    Storage storage = new Storage(url.getPath());
    List<Resource> pngResources = storage.findResources("**.png");
    pngResources.forEach(resource -> System.out.println(resource.getUri()));
}
Deferred write (usefull for write files from user events - mouse move, mouse up, etc.)
Storage storage = new Storage("path/to/directory/or/zip-file");
Resource resource = storage.getResource("test_file");
for (int i = 0; i < 100; i++) {
    resource.writeDeferred("content_" + i);
}
String value = resource.readToString(); //read immediately execute deferred writes - only last one 
System.out.println(value); // -> content_99

License

cuberact-json is released under the Apache 2.0 license.

Copyright 2017 Michal Nikodim

Licensed 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.
org.cuberact

Cuberact

Версии библиотеки

Версия
1.1.1
1.1.0
1.0.1
1.0.0