Java Path File Name nio convertFilePathToName(Path file)

Here you can find the source of convertFilePathToName(Path file)

Description

Turns a file path into a name suitable for use as the name of a premium or reserved list.

License

Open Source License

Declaration

public static String convertFilePathToName(Path file) 

Method Source Code


//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import com.google.common.io.Files;
import java.nio.file.Path;

public class Main {
    /** Turns a file path into a name suitable for use as the name of a premium or reserved list. */
    public static String convertFilePathToName(Path file) {
        return Files.getNameWithoutExtension(file.getFileName().toString());
    }//from w  ww .jav  a2  s.c  o  m
}

Related

  1. addRestorePermissions(String username, Path file)
  2. appendTargetToBuildFile(String targetName, Path dir)
  3. checkFile(final String friendlyname, final Path file, final boolean isdirectory, final boolean canwrite)
  4. compileAndLoad(Path basePath, String className)
  5. concatFileName(String fileName, Path pathLocation)
  6. detectFilePath(String propertyName, String confFileName)
  7. endsWith(File file, String pathname)
  8. fileName(final Path path)
  9. fileName(final Path thePath)