Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
22c4e1c
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Aug 1, 2025
c03f8e0
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Aug 5, 2025
30e45a1
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Aug 7, 2025
ca5a43d
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Aug 7, 2025
1019d53
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Sep 2, 2025
6806f6c
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Sep 2, 2025
94b9592
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Sep 4, 2025
2aabfa4
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Sep 17, 2025
a006394
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 8, 2025
c91e79b
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 8, 2025
69af51f
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 8, 2025
f555a44
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 8, 2025
3579452
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 15, 2025
0c09ff6
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 20, 2025
c3080d5
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 20, 2025
8a1161c
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 20, 2025
83f93d4
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 21, 2025
8598c6b
XCOMMONS-3250: Make as easy as possible for various features to use a…
michitux Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
<!-- JAXB -->
<jaxb.tools.version>2.0.15</jaxb.tools.version>

<!-- AWS SDK -->
<aws.java.sdk.version>2.35.10</aws.java.sdk.version>

<!-- By default, Checkstyle, Backward compatibility check, Enforcer, License plugins, etc., are on -->
<xwiki.checkstyle.skip>false</xwiki.checkstyle.skip>
<xwiki.revapi.skip>false</xwiki.revapi.skip>
Expand Down Expand Up @@ -1502,6 +1505,13 @@
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>${aws.java.sdk.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
Expand Down
1 change: 1 addition & 0 deletions xwiki-commons-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<module>xwiki-commons-properties</module>
<module>xwiki-commons-repository</module>
<module>xwiki-commons-script</module>
<module>xwiki-commons-store</module>
<module>xwiki-commons-stability</module>
<module>xwiki-commons-text</module>
<module>xwiki-commons-velocity</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<artifactId>xwiki-commons-job-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-store-blob-api</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.xwiki.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.filter.input;

import java.io.IOException;
import java.io.InputStream;

import org.xwiki.stability.Unstable;
import org.xwiki.store.StreamProvider;

/**
* An input source based on a {@link StreamProvider}.
*
* @version $Id$
* @since 17.10.0RC1
*/
@Unstable
public class DefaultStreamProviderInputSource extends AbstractInputStreamInputSource
{
private final StreamProvider streamProvider;

/**
* Create a new input source based on the passed stream provider.
*
* @param streamProvider the stream provider to use
*/
public DefaultStreamProviderInputSource(StreamProvider streamProvider)
{
this.streamProvider = streamProvider;
}

@Override
protected InputStream openStream() throws IOException
{
try {
return this.streamProvider.getStream();
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw new IOException("Failed to open stream", e);
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.filter.output;

import java.io.IOException;
import java.io.OutputStream;

import org.xwiki.stability.Unstable;
import org.xwiki.store.blob.Blob;

/**
* An implementation of {@link OutputStreamOutputTarget} that writes to a {@link Blob}.
*
* @version $Id$
* @since 17.10.0RC1
*/
@Unstable
public class DefaultBlobOutputTarget extends AbstractOutputStreamOutputTarget
{
private final Blob blob;

/**
* Create an instance of {@link OutputStreamOutputTarget} returning the passed {@link Blob}'s output stream.
*
* @param blob the {@link Blob}
*/
public DefaultBlobOutputTarget(Blob blob)
{
this.blob = blob;
}

@Override
protected OutputStream openStream() throws IOException
{
try {
return this.blob.getOutputStream();
} catch (Exception e) {
throw new IOException("Failed to open blob output stream", e);
}
}
}
38 changes: 38 additions & 0 deletions xwiki-commons-core/xwiki-commons-store/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-core</artifactId>
<version>17.10.0-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-store</artifactId>
<name>XWiki Commons - Store</name>
<packaging>pom</packaging>
<description>XWiki Commons - Store</description>
<modules>
<module>xwiki-commons-store-api</module>
<module>xwiki-commons-store-blob</module>
</modules>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-store</artifactId>
<version>17.10.0-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-store-api</artifactId>
<name>XWiki Commons - Store - API</name>
<packaging>jar</packaging>
<description>Storage API for accessing data in a storage backend</description>
<properties>
<xwiki.jacoco.instructionRatio>0.76</xwiki.jacoco.instructionRatio>
</properties>
<dependencies>
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-component-api</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Testing dependencies -->
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-tool-test-simple</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.store;

import java.io.Serial;

import org.xwiki.stability.Unstable;

/**
* Base exception for store related APIs.
*
* @version $Id$
* @since 17.1.0RC1
*/
@Unstable
public class StoreException extends Exception
{
/**
* Serialization identifier.
*/
@Serial
private static final long serialVersionUID = 1L;

/**
* @param message exception message
*/
public StoreException(String message)
{
super(message);
}

/**
* @param message exception message
* @param cause nested exception
*/
public StoreException(String message, Throwable cause)
{
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.store;

import java.io.InputStream;

/**
* A generic thing which provides access to an InputStream on demand.
*
* @version $Id$
* @since 3.0M2
*/
public interface StreamProvider
{
/**
* Get the stream provided by this StreamProvider.
*
* @return the stream which this StreamProvider provides.
* @throws Exception if something goes wrong while trying to get the stream.
*/
InputStream getStream() throws Exception;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-store</artifactId>
<version>17.10.0-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-store-blob</artifactId>
<name>XWiki Commons - Store - Blob</name>
<packaging>pom</packaging>
<description>Blob storage</description>
<modules>
<module>xwiki-commons-store-blob-api</module>
<module>xwiki-commons-store-blob-filesystem</module>
<module>xwiki-commons-store-blob-s3</module>
</modules>
</project>
Loading