class SavepointStore {

	public static <T extends Savepoint> String storeSavepoint(String directory, T savepoint) throws IOException {
		// write and create the file handle
		FileStateHandle metadataFileHandle = storeSavepointToHandle(directory,
			SAVEPOINT_METADATA_FILE, savepoint);

		// we return the savepoint directory path here!
		// The directory path also works to resume from and is more elegant than the direct
		// metadata file pointer
		return metadataFileHandle.getFilePath().getParent().toString();
	}

}