Example usage for java.util UUID randomUUID

List of usage examples for java.util UUID randomUUID

Introduction

In this page you can find the example usage for java.util UUID randomUUID.

Prototype

public static UUID randomUUID() 

Source Link

Document

Static factory to retrieve a type 4 (pseudo randomly generated) UUID.

Usage

From source file:com.joshlong.esb.springintegration.modules.net.feed.web.test.NewsItem.java

public NewsItem() {
    this.id = UUID.randomUUID().toString();
}

From source file:backtype.storm.utils.LocalStateTest.java

@Before
public void setUp() throws Exception {
    dir = System.getProperty("java.io.tmpdir") + File.separator + UUID.randomUUID().toString();
    ls = new LocalState(dir);
    vs = new VersionedStore(dir);

}

From source file:guru.qas.martini.gherkin.FeatureWrapper.java

public FeatureWrapper(Feature feature, Resource resource) {
    this(UUID.randomUUID(), feature, resource);
}

From source file:br.eti.danielcamargo.backend.common.core.business.UsuarioService.java

@Transactional
public void createFacebook(Usuario usuario) {
    usuario.setFacebook(true);//from  ww  w  .  ja  v a  2  s . c o m
    usuario.setConfirmado(true);
    usuario.setChaveConfirmacao(UUID.randomUUID().toString());
    em.persist(usuario);
}

From source file:org.bahmni.test.builder.DrugOrderBuilder.java

public DrugOrderBuilder() {
    this.order = new DrugOrder();
    this.order.setUuid(UUID.randomUUID().toString());
    this.order.setDateCreated(null);
    this.order.setDrug(new Drug(123));
    this.order.setOrderType(new OrderType());
}

From source file:io.renren.modules.oss.cloud.CloudStorageService.java

/**
 * /*w  w w .  j  a  v a  2  s. c om*/
 * @param prefix ?
 * @param suffix ?
 * @return 
 */
public String getPath(String prefix, String suffix) {
    //?uuid
    String uuid = UUID.randomUUID().toString().replaceAll("-", "");
    //
    String path = DateUtils.format(new Date(), "yyyyMMdd") + "/" + uuid;

    if (StringUtils.isNotBlank(prefix)) {
        path = prefix + "/" + path;
    }

    return path + suffix;
}

From source file:gr.upatras.ece.nam.baker.InstalledServiceTest.java

@Test
public void testSetUuid() {
    InstalledBun is = installedServiceInit();
    UUID uuid = UUID.randomUUID();
    is.setUuid(uuid.toString());
    assertEquals(uuid.toString(), is.getUuid());

}

From source file:com.allogy.io.BulkUpdateInputStreamTest.java

@Before
public void setUp() {
    innerStrings = new ArrayList<String>();
    innerInputStreams = new ArrayList<InputStream>();
    for (int i = 0; i < 3; i++) {
        String string = UUID.randomUUID().toString();
        innerStrings.add(string);//  ww w . j  a v  a 2  s  .c o m
        innerInputStreams.add(IOUtils.toInputStream("\"" + string + "\""));
    }
}

From source file:net.gplatform.spring.social.base.SimpleConnectionSignUp.java

/**
 * here use random generated id to act as localUserId, localUserId will be the key to save connection & sign
 *//*  w w w .  ja v a2s.  c om*/
@Override
public String execute(Connection<?> connection) {
    String localUserId = UUID.randomUUID().toString();
    logger.debug("Local User ID is: {}", localUserId);
    return localUserId;
}

From source file:rzd.vivc.documentexamination.service.FileSavingToDiskService.java

@Override
public void saveUploadedFile(DocumentForm document) throws IOException {
    Part file = document.getFile();//w w w . ja  v a2 s .com

    if (file == null || file.getSize() < 0 || file.getSubmittedFileName().isEmpty()) {
        //?    ,  ? ? ? 
    } else {
        String address = "C:" + File.separator + File.separator + "documents" + File.separator;
        String name = file.getSubmittedFileName();
        while ((new File(address + name)).exists()) {
            String[] split = name.split("\\.");
            name = split[split.length - 2] + UUID.randomUUID().toString() + "." + split[split.length - 1];
        }
        file.write(address + name);
        document.setFileName(name);
    }
}