public class

AssetsDir

extends Object

 java.lang.Object

↳com.parrot.docdown.generator.AssetsDir

Overview

Manages resources asset directory.

Supports getting asserts from a jar or in the classes directory

Summary

Fields
private final ClassLoaderclassloader

private final PathcontentDirPath

private final PathdestDirPath

private final PathsrcDirPath

Constructors
publicAssetsDir(Path srcPath, Path destPath, Path contentPath, ClassLoader classloader)

Constructor

Methods
public voidcopy()

Copy assets files to the output directory.

private voidcopyAssetFileListFromDir(URL assertDirUrl)

Copy assets from the classes directory

private voidcopyAssetFileListFromJar(URL assertDirUrl)

Copy assets from a jar

private voidcopyDirectoryFiles(Path basePath, Path dir)

Deep copy directory files.

public PathgetPath()

Gets the path of copied assets directory.

from Object, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait

Fields

private final Path srcDirPath

private final Path destDirPath

private final Path contentDirPath

private final ClassLoader classloader

Constructors

public AssetsDir(Path srcPath, Path destPath, Path contentPath, ClassLoader classloader)

Constructor

Parameters:

srcPath: path of resource directory containing the assets to copy.
destPath: path where to copy the assets.
contentPath: path of the directory to copy.
classloader: classloader to get the resource.

Methods

public Path getPath()

Gets the path of copied assets directory.

Returns:

path of copied assets directory

public void copy()

Copy assets files to the output directory.

private void copyAssetFileListFromJar(URL assertDirUrl)

Copy assets from a jar

Parameters:

assertDirUrl: url of the assets directory

private void copyAssetFileListFromDir(URL assertDirUrl)

Copy assets from the classes directory

Parameters:

assertDirUrl: url of the assets directory

private void copyDirectoryFiles(Path basePath, Path dir)

Deep copy directory files.

Parameters:

basePath: base directory containing the directory to copy.
dir: directory to copy