Example usage for org.springframework.boot.devtools.restart.classloader ClassLoaderFile ClassLoaderFile

List of usage examples for org.springframework.boot.devtools.restart.classloader ClassLoaderFile ClassLoaderFile

Introduction

In this page you can find the example usage for org.springframework.boot.devtools.restart.classloader ClassLoaderFile ClassLoaderFile.

Prototype

public ClassLoaderFile(Kind kind, long lastModified, byte[] contents) 

Source Link

Document

Create a new ClassLoaderFile instance.

Usage

From source file:org.springframework.boot.devtools.remote.client.ClassPathChangeUploader.java

private ClassLoaderFile asClassLoaderFile(ChangedFile changedFile) throws IOException {
    ClassLoaderFile.Kind kind = TYPE_MAPPINGS.get(changedFile.getType());
    byte[] bytes = (kind == Kind.DELETED ? null : FileCopyUtils.copyToByteArray(changedFile.getFile()));
    long lastModified = (kind == Kind.DELETED ? System.currentTimeMillis()
            : changedFile.getFile().lastModified());
    return new ClassLoaderFile(kind, lastModified, bytes);
}