equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
41 import java.net.URI; |
41 import java.net.URI; |
42 import java.nio.file.DirectoryStream; |
42 import java.nio.file.DirectoryStream; |
43 import java.nio.file.Files; |
43 import java.nio.file.Files; |
44 import java.nio.file.NoSuchFileException; |
44 import java.nio.file.NoSuchFileException; |
45 import java.nio.file.Path; |
45 import java.nio.file.Path; |
46 import java.nio.file.Paths; |
|
47 import java.nio.file.attribute.BasicFileAttributes; |
46 import java.nio.file.attribute.BasicFileAttributes; |
48 import java.util.ArrayList; |
47 import java.util.ArrayList; |
49 import java.util.Collections; |
48 import java.util.Collections; |
50 import java.util.HashMap; |
49 import java.util.HashMap; |
51 import java.util.List; |
50 import java.util.List; |
358 */ |
357 */ |
359 private String fileName(ModuleReference mref) { |
358 private String fileName(ModuleReference mref) { |
360 URI uri = mref.location().orElse(null); |
359 URI uri = mref.location().orElse(null); |
361 if (uri != null) { |
360 if (uri != null) { |
362 if (uri.getScheme().equalsIgnoreCase("file")) { |
361 if (uri.getScheme().equalsIgnoreCase("file")) { |
363 Path file = Paths.get(uri); |
362 Path file = Path.of(uri); |
364 return file.getFileName().toString(); |
363 return file.getFileName().toString(); |
365 } else { |
364 } else { |
366 return uri.toString(); |
365 return uri.toString(); |
367 } |
366 } |
368 } else { |
367 } else { |