Android Open Source - you2peer Item File






From Project

Back to project page you2peer.

License

The source code is released under:

Apache License

If you think the Android project you2peer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.u2p.ui.component;
/* ww w .j  a va 2s.c o  m*/
import java.io.File;
import java.io.Serializable;
import java.net.InetAddress;

import com.u2p.core.db.DbFile;

public class ItemFile implements Serializable{

  private static final long serialVersionUID = 8858451646619645528L;
  private long id;
  private int pos,neg;
  private String rutaImagen;
  private String name;
  private String user;
  private String size;
  private String rating;
  private String group;
  private InetAddress address;
  

  public ItemFile(DbFile file, String user, String rutaImagen){
        setId(file.getId());
        setRutaImagen(rutaImagen);
        setName(file.getName());
        setUser(user);
        File f = new File(file.getUri());
        setSize(Integer.toString((int)f.length()));
    this.pos=file.getPositive();
    this.neg=file.getNegative();
    int total = pos+neg;
        setRating(Integer.toString(pos) + "/" + Integer.toString(total));
        setGroup(file.getGroup());
    }
  

  public int getPositives() {
    return pos;
  }

  public void setPositives() {
    this.pos = this.pos+1;
  }

  public int getNegatives() {
    return neg;
  }

  public void setNegatives() {
    this.neg = this.neg+1;
  }

  public void setAddress(InetAddress address){
    this.address=address;
  }
  
  public InetAddress getAddress(){
    return this.address;
  }
  
  public String getGroup() {
    return group;
  }

  public void setGroup(String group) {
    this.group = group;
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public String getRutaImagen() {
    return rutaImagen;
  }

  public void setRutaImagen(String rutaImagen) {
    this.rutaImagen = rutaImagen;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getSize() {
    return size;
  }

  public void setSize(String size) {
    this.size = size;
  }

  public String getRating() {
    int total = pos+neg;
    this.rating = Integer.toString(pos)+"/"+Integer.toString(total);
    return this.rating;
  }

  public void setRating(String rating) {
    this.rating = rating;
  }

  public String getUser() {
    return user;
  }

  public void setUser(String user) {
    this.user = user;
  }
}




Java Source Code List

com.u2p.core.comm.Client.java
com.u2p.core.comm.Server.java
com.u2p.core.db.DbDataSource.java
com.u2p.core.db.DbFile.java
com.u2p.core.db.DbGroups.java
com.u2p.core.db.DbU2P.java
com.u2p.core.db.DbUser.java
com.u2p.core.nsd.NsdHelper.java
com.u2p.events.ActivityEventsGenerator.java
com.u2p.events.ActivityEventsListener.java
com.u2p.events.ActivityEvents.java
com.u2p.events.FileEvent.java
com.u2p.events.ListEvent.java
com.u2p.events.NewClientEvent.java
com.u2p.events.NewGroupList.java
com.u2p.events.ServerEventsGenerator.java
com.u2p.events.ServerEventsListener.java
com.u2p.events.VoteEvent.java
com.u2p.messages.ACK.java
com.u2p.messages.Authentication.java
com.u2p.messages.FileAnswer.java
com.u2p.messages.FileRequest.java
com.u2p.messages.ListAnswer.java
com.u2p.messages.ListRequest.java
com.u2p.messages.NewFile.java
com.u2p.messages.StillAlive.java
com.u2p.messages.VoteFile.java
com.u2p.ui.FileDetailsActivity.java
com.u2p.ui.FileSelectionActivity.java
com.u2p.ui.MainActivity.java
com.u2p.ui.adapters.ItemFileAdapter.java
com.u2p.ui.component.GroupListFile.java
com.u2p.ui.component.ItemFile.java
com.u2p.ui.component.LoginDialogFragment.java