Fixe meta file name
This commit is contained in:
parent
77857289f0
commit
6d396368b7
@ -18,6 +18,7 @@
|
|||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Meta file name in readMeta from directory
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ plugins {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = "space.kscience"
|
group = "space.kscience"
|
||||||
version = "0.6.0-dev-1"
|
version = "0.6.0-dev-2"
|
||||||
repositories{
|
repositories{
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,8 @@ import space.kscience.dataforge.meta.set
|
|||||||
import space.kscience.dataforge.names.*
|
import space.kscience.dataforge.names.*
|
||||||
import kotlin.reflect.KType
|
import kotlin.reflect.KType
|
||||||
|
|
||||||
public interface DataSet<out T : Any> {
|
public interface
|
||||||
|
DataSet<out T : Any> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The minimal common ancestor to all data in the node
|
* The minimal common ancestor to all data in the node
|
||||||
|
@ -91,6 +91,10 @@ public fun EnvelopeFormat.readFile(path: Path): Envelope {
|
|||||||
public inline fun <reified T : Any> IOPlugin.resolveIOFormat(): IOFormat<T>? =
|
public inline fun <reified T : Any> IOPlugin.resolveIOFormat(): IOFormat<T>? =
|
||||||
ioFormatFactories.find { it.type.isSupertypeOf(typeOf<T>()) } as IOFormat<T>?
|
ioFormatFactories.find { it.type.isSupertypeOf(typeOf<T>()) } as IOFormat<T>?
|
||||||
|
|
||||||
|
|
||||||
|
public val IOPlugin.Companion.META_FILE_NAME: String get() = "@meta"
|
||||||
|
public val IOPlugin.Companion.DATA_FILE_NAME: String get() = "@data"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read file containing meta using given [formatOverride] or file extension to infer meta type.
|
* Read file containing meta using given [formatOverride] or file extension to infer meta type.
|
||||||
* If [path] is a directory search for file starting with `meta` in it
|
* If [path] is a directory search for file starting with `meta` in it
|
||||||
@ -103,7 +107,7 @@ public fun IOPlugin.readMetaFile(
|
|||||||
if (!Files.exists(path)) error("Meta file $path does not exist")
|
if (!Files.exists(path)) error("Meta file $path does not exist")
|
||||||
|
|
||||||
val actualPath: Path = if (Files.isDirectory(path)) {
|
val actualPath: Path = if (Files.isDirectory(path)) {
|
||||||
Files.list(path).asSequence().find { it.fileName.startsWith("meta") }
|
Files.list(path).asSequence().find { it.fileName.startsWith(IOPlugin.META_FILE_NAME) }
|
||||||
?: error("The directory $path does not contain meta file")
|
?: error("The directory $path does not contain meta file")
|
||||||
} else {
|
} else {
|
||||||
path
|
path
|
||||||
@ -147,8 +151,6 @@ public fun IOPlugin.peekFileEnvelopeFormat(path: Path): EnvelopeFormat? {
|
|||||||
return peekBinaryEnvelopeFormat(binary)
|
return peekBinaryEnvelopeFormat(binary)
|
||||||
}
|
}
|
||||||
|
|
||||||
public val IOPlugin.Companion.META_FILE_NAME: String get() = "@meta"
|
|
||||||
public val IOPlugin.Companion.DATA_FILE_NAME: String get() = "@data"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read and envelope from file if the file exists, return null if file does not exist.
|
* Read and envelope from file if the file exists, return null if file does not exist.
|
||||||
|
Loading…
Reference in New Issue
Block a user