Code example for Path

Methods: getFileName

0
	} 
 
	@Override 
	public void processFile(final NodeWriteTrx trx, Path path,
			final Optional<BasicFileAttributes> attrs) {
		if (Files.exists(path)) {
			final String file = path.getFileName().toString();
			final int index = file.lastIndexOf('.');
			if (index > 0) {
				final String suffix = file.substring(index + 1);
				if (!suffix.isEmpty()) {
					try { 
						trx.insertAttribute(new QNm("suffix"), file.substring(index + 1));
						trx.moveToParent();
					} catch (SirixException e) {
						LOGWRAPPER.error(e.getMessage(), e);
					} 
				} 
			} 
		}