TNFSJ

Another implementation of the TNFS protocol, file transfer designed especially for lower power and retro hardware.

The TNFSJ project is a complete SDK for working with TNFS on Linux, Windows, Mac OS or any other computers capable of running Java. It includes several client programs, a TNFS server, a fully feature web based TNFS server browser, an easy to use drive mapping tool and a full set of libraries if you want to make your own TNFS Java application.

Also see the original TNFSD and the FujiNet fork. TNFSJ should be entirely interoperable with this and any clients that work with it.

While TNFSJ is 100% pure Java, for best performance and ease of use, consider starting with the native SDK build for your platform if it is available. These have been built with Graal Native Image.

By default, TNFS is not a secure file system. Do not use it on an untrusted and public networks for anything remote confidential. This includes the BASIC authentication method, as your password is transmitted in clear text!

Client Tools

There are several reference client tools.

  • The tnfscp command. Simply copies files to and from a remote TNFS server.
  • The tnfsfp command. This is an interactive file transfer shell, much like the venerable ftp command found on UNIX.

File System Mounting

Rather than copying files to and from the TNFS server to your computer to work with, you could instead Mount the TNFS server as a local drive, and then access those remote files as if they were stored on your computer from any application.

This functionality is provided by the tnfs-fuse command. This presents a TNFS mount as a local drive, allowing it to be used transparently with any application.

Note, tnfs-fuse is currently unable to run natively compiled, so must be launched with a Java runtime.

Server

The server supports all the functions of the official server, and more. For example, it will announce itself using Zeroconf, allowing other tools (including the other TNFSJ components) to locate the server without knowing its address. It can also use UPnP to automatically open a port on your firewall when it runs.

The server also implements some unofficial protocol extensions, that may only be used with TNFSJ tools. For example, the SPECK cipher is used to provide experimental encryption.

The recommended way to get a server up and running is to use the pre-built Docker images at Docker Hub.

docker pull bithatch/tnfsjd:v0_9_0

The server is also included in the SDK, so see Downloads for your platform.

Web Front End

TNFSJ includes a mini web server that allows you (or anyone you choose to make it available to) to view, upload, download, delete, rename and perform nearly any other file operation possible on the files shared by your TNFS server.

It is based on the great elFinder, and can be found in the Downloads, either separately or part of the SDK bundle.

The recommended way to get the web front up and running is to use the pre-built Docker images at Docker Hub.

docker pull bithatch/tnfsjd-web:v0_9_0

The server is also included in the SDK, so see Downloads for your platform.

Library

Not only is TNFSJ a capable TNFS implementation itself, you can also use the libraries it is based on in your own applications.

The library is available in Maven Central, so just add the libraries coordinates to your favourite build tool such as Maven.

<dependency>
    <artifactId>tnfs-java-lib</artifactId>
    <groupId>tnfs-java-lib</groupId>
    <version>0.9.0</version>
</dependency>

Currently best way to learn how to use the libraries is from the source of the other TNFSJ tools such as tnfscp.

Java NIO File System Provider

The fastest way to integrate TNFS into your Java application is probably to use File System Provider. Similar to the FUSE provider above, this allows access to TNFS resource as if they were local files, but only from within Java, and with the advantage of a standard library that runs on all platforms with no further work.

If you are using Path to access local files in application, getting TNFS support is as easy as adding the library and using the special URI format.

<dependency>
<artifactId>tnfs-java-nio</artifactId>
<groupId>tnfs-java-nio</groupId>
<version>0.9.0</version>
</dependency>

Then when you create a Path, do something like …

var path = Paths.get("tnfs://localhost/readme.txt");
try(var in = Files.newInputStream(path)) {
    in.transferTo(System.out);
}

See the Project Page for more information.

SDK

Available on the Downloads page, the SDK contains all the client tools, the TNFS server and its tools, the web front end daemon, all protocol extensions and the core protocol libraries.

These will either be a cross-platform build, for which you must provide you own Java runtime, or they will be native builds which can just be run without any other runtime.