001/* 002 * (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Florent Guillaume 016 */ 017package org.nuxeo.ecm.platform.picture.api; 018 019import java.io.File; 020 021import org.nuxeo.ecm.core.api.Blob; 022 023/** 024 * Helpers around Blob objects. 025 * 026 * @since 5.6 027 */ 028public class BlobHelper { 029 030 // utility class 031 private BlobHelper() { 032 } 033 034 /** 035 * If the blob is backed by an actual file, return it. 036 * <p> 037 * Note that the File may be short-lived (temporary file), so should be used immediately. 038 * 039 * @return a File, or {@code null} if this blob doesn't have one 040 * @deprecated since 7.2, use {@link Blob#getFile} directly 041 */ 042 @Deprecated 043 public static File getFileFromBlob(Blob blob) { 044 return blob.getFile(); 045 } 046 047}