@Test public void testPathNotTooLong() { final String temp = StringUtils.removeEnd(System.getProperty("java.io.tmpdir"), File.separator); final String testPathDirectory = "/Lorem/ipsum/dolor/sit/amet/consetetur/sadipscing/elitr/sed/diam/nonumy/eirmod/tempor"; final String testPathFile = "takimata.sanc"; final String testPath = String.format("%s/%s", testPathDirectory, testPathFile); final String testPathMD5 = DigestUtils.md5Hex(testPathDirectory); Path file = new Path(testPath, EnumSet.of(Path.Type.file)); file.attributes().setVersionId("2"); final Local local = new DefaultTemporaryFileService().create("UID", file); final String localFile = local.getAbsolute(); assertEquals(String.format("%s/%s%s/2/%s", temp, "UID", testPathDirectory, testPathFile).replace('/', File.separatorChar), localFile); assertNotEquals(String.format("%s/%s%s/2/%s", temp, "UID", testPathMD5, testPathFile).replace('/', File.separatorChar), localFile); }
@Override public Local create(final Path file) { return this.create(new UUIDRandomStringService().random(), file); }
DefaultTemporaryFileService extends AbstractTemporaryFileService implements TemporaryFileService { @Override public Local create(final Path file) { return this.create(new UUIDRandomStringService().random(), file); } }
DefaultTemporaryFileService extends AbstractTemporaryFileService implements TemporaryFileService { @Override public Local create(final Path file) { return this.create(new UUIDRandomStringService().random(), file); }  }
DefaultTemporaryFileService extends AbstractTemporaryFileService implements TemporaryFileService { @Override public Local create(final Path file) { return this.create(new UUIDRandomStringService().random(), file); }  @Override Local create(final Path file); @Override Local create(final String name); @Override Local create(final String uid, final Path file); }
DefaultTemporaryFileService extends AbstractTemporaryFileService implements TemporaryFileService { @Override public Local create(final Path file) { return this.create(new UUIDRandomStringService().random(), file); }  @Override Local create(final Path file); @Override Local create(final String name); @Override Local create(final String uid, final Path file);  }